<html>
    <head>
        <meta charset="utf-8">
        <meta http-equiv="Access-Control-Allow-Origin" content="*">
        <style>
            .fadeIn {
                -webkit-animation-name: fadeIn;
                animation-name: fadeIn;
            }
            
            .animated {
                -webkit-animation-duration: 1s;
                animation-duration: 1s;
                -webkit-animation-fill-mode: both;
                animation-fill-mode: both;
            }

             @keyframes fadeIn{
                 0% {
                     opacity: 0;
                 }
                 100%{
                     opacity: 1
                 }
             }
            .jsonview{font-family:monospace;font-size:1.1em;white-space:pre-wrap}.jsonview .prop{font-weight:700;text-decoration:none;color:#000}.jsonview .null,.jsonview .undefined{color:red}.jsonview .bool,.jsonview .num{color:#00f}.jsonview .string{color:green;white-space:pre-wrap}.jsonview .string.multiline{display:inline-block;vertical-align:text-top}.jsonview .collapser{position:absolute;left:-1em;cursor:pointer}.jsonview .collapsible{transition:height 1.2s;transition:width 1.2s}.jsonview .collapsible.collapsed{height:.8em;width:1em;display:inline-block;overflow:hidden;margin:0}.jsonview .collapsible.collapsed:before{content:"…";width:1em;margin-left:.2em}.jsonview .collapser.collapsed{transform:rotate(0)}.jsonview .q{display:inline-block;width:0;color:transparent}.jsonview li{position:relative}.jsonview ul{list-style:none;margin:0 0 0 2em;padding:0}.jsonview h1{font-size:1.2em}
            *{
                box-sizing: border-box;
            }
            html,body{width: 100%; height: 100%; margin:0; padding: 0;}
            hr{
                margin: 30px 0;
            }
            .div_module{
                width:80%;
                margin: 20px auto;
            }
            .div_module input,.div_module select,.div_module textarea{
                width: 100%;
            }
   
            .div_module_c{
                margin-bottom: 30px;
            }
            .div_module_c h2{
                text-align: center;
                padding-bottom: 10px;
                border-bottom: 1px solid #ddd;
            }
            .sel_goods{
                padding: 3px 0;
            }         
            .div_getOperations table td{
                border-bottom: 1px solid #eee;
            }  
            table{
                width: 100%;
                border-collapse: collapse;
                border-spacing: 0;
            }

            th,td{
                text-align: left;
            }

            .body{
                width: 100%;
            }

            .container{
                height: 100%;
                display: flex;
                /* overflow: hidden; */
            }
            .left_nav{
                padding: 30px 30px 0 10px;   
                height: 100%;
                overflow: auto;     
                width: 390px; 
                min-width: 390px;      
            }
            .left_nav ul{
                list-style: decimal-leading-zero;
            }
            
            .right_main_content{
                flex: 1;
                border-left:1px dotted green;
                display: flex;
                flex-direction: column;
            }
            .right_main_content .top{
                border-bottom:1px dotted green;
            }
            .container .body{
                flex: 1;
                overflow:auto;
            }

            .top .div_module_c{
                margin-bottom: 0;
            }

            .h_msg{
                margin:0;
                color:red;
                padding-left: 20px;
            }
            .h_msg::before{
                content: "消息："
            }
            .div_unlock{
                padding-bottom: 0;
            }

            .left_nav .p_account{margin-bottom: 20px; padding-left: 10px;}

            .listCard .row{
                display: flex;
                margin-bottom:6px;
            }
            .listCard .row:last-child{
                display: block;
            }
            .listCard .row .field{
                width: 160px;
            }
            .listCard .row .value{
                flex: 1;
            }
            .transactions h4{
                margin:8px 0;
            }

            .blockOrTXID .transactions{
                margin-top: 16px;
            }

            .blockOrTXID .row_op{
                margin-bottom: 8px;
            }
            .blockOrTXID .row_op .info{
                margin: 6px 0;
            }

            .blockOrTXID .row_op .type{
                color:green;
            }

            .blockOrTXID .row_op .time{
                color:#999;
            }
            .div_getWitnessesForExplorer .activeNodeClass>td {
                background: rgba(80, 210, 194, 0.4);
            }

            .div_get_contract p,.div_getAccountContractData p{
                border-bottom: 1px solid #eee;
                padding-bottom: 6px;
            }
            
            .op_results{
                display: none;
                color:gray;
                margin-top: 6px;
            }
            .op_results p{
                border-top:1px solid #eee;
                margin: 2px 0;
            }

            .checkbox{
                display: flex;
                align-items: center;
                margin: 10px 0;
            }
            input[type="checkbox"]{
                margin:3px 6px 0;
            }

            .div_getAssets .div_list P{
                display: flex;
                justify-content: space-between;
            }

            .red{
                color:red;
            }
            .green{
                color:green;
            }
            .div_subscribeToTransactionPair .container{
                display:flex;
                height: auto;
            }
            .orders{
                flex: 1;
                padding-left: 30px;
            }
            .orders tbody tr:hover{
                background: rgba(0,0,0,0.6);
                color:#fff;
                cursor: pointer;
            }
            .btn{
                padding: 10px 0;
                color:#fff;
                font-size: 16px;
            }

            .buy_balances,.sell_balances{
                margin: 0;
            }

            .op_results p{
                word-wrap: break-word; 
            }
            .game_item_base_describe{
                word-break:break-all;
                word-wrap:break-word;
                padding-right:10px;
                /* width:200px; */
            }
            .new_options{
                margin-top: 6px;
                border-top:1px solid #dedede;
            }
            .memo{
                margin-left: 6px;
            }
            .res{
                max-width: 600px;
                overflow: auto;
            }

            .div_loadAccountProposals .rows{
                width: 250px;
                display: flex;
                justify-content: space-between;
            }

            .td-status{
                /* border:1px solid #eee; */
                padding: 10px 0;
            }
            .div_loadAccountProposals input[type=checkbox]{
                width: auto;
            }
            .div_bitassetOpts{
                display:none;
            }
/* 
            .scroll{
                max-height:250px;
                overflow:auto;
            } */
        </style>
    </head>
    <body>
      <div class="container">
        <div class="left_nav">
            <p class="p_account">当前账户：<span class="current_account"></span></p>
            <ul>
                <li>钱包管理模式
                    <ul class="class_0">

                    </ul>
                </li>
                <li>账户管理模式
                    <ul class="class_1">

                    </ul>
                </li>
                <li>账户操作
                    <ul class="class_11">

                    </ul>
                </li>
                <li>代币资产操作
                    <ul class="class_2">

                    </ul>
                </li>
                <li>NH资产操作
                    <ul class="class_3">

                    </ul>
                </li>
                <li>NH资产查询
                    <ul class="class_5">

                    </ul>
                </li>
                <li>区块链浏览器
                    <ul class="class_7">

                    </ul>
                </li>
                <li>API服务器节点
                    <ul class="class_8">

                    </ul>
                </li>
                <li>合约
                    <ul class="class_9">

                    </ul>
                </li>
                <li>交易市场
                    <ul class="class_10">

                    </ul>
                </li>
                <li>其他
                    <ul class="class_12">

                    </ul>
                </li>
            </ul>
        </div>
        <div class="right_main_content">
                <div class="top">
                    <h2 class="h_msg"></h2>
                    <div class="div_module_c" pclass="class_1">
                        <h2 style="border-bottom:0; padding-bottom:0; margin:6px 0;">钱包解锁与锁定</h2>
                        <div class="div_unlock div_module">
                            <p>私钥模式登录可以使用该方法</p>
                            <input type="text" class="pwd" placeholder="解锁密码" value="12345678"/><br><br>
                            <input type="button" id="btn_unlock" value="确认解锁"  /><br><br>
                            <input type="button" id="btn_lock" value="确认锁定"  />
                        </div>
                    </div>
                </div>
        
                <div class="body">
                        <div class="div_module_c" id="div_createAccountWithWallet" pclass="class_0"  >
                            <h2>钱包模式创建账户</h2>
                            <div class="div_createAccountWithWallet div_module">
                                <p class="red">如果钱包模式已经存在账户，该操作会创建子账户，创建该子账户需要操作账户为终身会员账户</p>
                                用户名(规则/^[a-z][a-z0-9\.-]{4,63}$//)<input type="text" class="signup_username"  value="test1"><br><br>
                                密码<input type="text" class="signup_pwd"  value="12345678"><br><br><br>
                                <input type="button" class="btn_signup" value="确认创建账户"  />
                                <p class="res"></p>
                            </div>
                        </div>
                        <div class="div_module_c" id="div_backupDownload" pclass="class_0"  >
                            <h2>备份钱包下载</h2>
                            <div class="div_backupDownload div_module">
                                <input type="button" id="btn_backupDownload" value="确认下载"  />
                            </div>
                        </div>
                        <div class="div_module_c" id="div_restoreWalletFile" pclass="class_0"  >
                            <h2>备份文件恢复钱包</h2>
                            <div class="div_restoreWalletFile div_module">
                                选择钱包文件
                                <input  type="file" value="选择钱包文件" class="file"  />
                                <div class="div_restore" style="display:none">
                                    <p>SHA1:<span class="sha1"></span></p>
                                    <input type="password" class="password" placeholder="请输入钱包密码" /><br><br>
                                    <input type="button" id="btn_restoreWallet" value="确认恢复"  />
                                </div>
                            </div>
                        </div>
                        <div class="div_module_c" id="div_deleteWallet" pclass="class_0"  >
                                <h2>删除钱包</h2>
                                <div class="div_deleteWallet div_module">
                                    删除钱包前再次确认是否已备份钱包或私钥
                                    <input type="button" id="btn_deleteWallet" value="确认删除"  />
                                </div>
                            </div>
                        <div class="div_module_c" id="div_importPrivateKey" pclass="class_0" >
                            <h2>导入私钥</h2>
                            <div class="div_importPrivateKey div_module">
                                <input type="text" class="pwd" value="12345678" placeholder="请设置临时密码" /><br><br>
                                <input type="text" class="privateKey" value="5JTRWBhT98rw8oCKWz5MVJEciYRed8ogqDifvqturWEE3UQPND3" placeholder="请输入账号私钥" /><br><br>
                                <input type="button" id="btn_importPrivateKey" value="确认导入"  />
                            </div>
                        </div>
                        <div class="div_module_c" id="div_getAccounts" pclass="class_0" >
                            <h2>获取钱包账户列表</h2>
                            <div class="div_getAccounts div_module">
                                <input type="button" id="btn_getAccounts" value="确认获取"  />
                                <p class="res"></p>
                                <table class="table">
                                    <thead>
                                        <tr>
                                            <th>#</th>
                                            <th>账户名称</th>
                                            <th>操作</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                        <div class="div_module_c" id="div_signup" pclass="class_1"  >
                            <h2>账户模式创建账户</h2>
                            <div class="div_signup div_module">
                                <p class="red">如果账户模式已经登录，该操作会创建子账户，创建该子账户需要操作账户为终身会员账户</p>
                                用户名(规则/^[a-z][a-z0-9\.-]{4,63}$/)<input type="text" id="signup_username"  value="test1"><br><br>
                                密码<input type="text" id="signup_pwd"  value="12345678"><br><br><br>
                                <input type="button" id="btn_signup" value="注册"  />
                            </div>
                        </div>
                        <div class="div_module_c"  id="div_login" pclass="class_1" >
                            <h2>登录</h2>
                            <div class="div_login div_module">
                                    <!-- tom0002,12345678 -->
                                用户名<input type="text" id="login_username"  value="test1"><br><br>
                                密码<input type="text" id="login_pwd"  value="12345678"><br><br><br>
                                <input type="button" id="btn_login" value="登录"  />
                            </div>
                        </div>
                        <div class="div_module_c" id="div_keyLogin" pclass="class_1" >
                            <h2>私钥登录</h2>
                            <div class="div_keyLogin div_module">
                                <input type="text" class="pwd" value="12345678" placeholder="请设置临时密码" /><br><br>
                                <input type="text" class="privateKey" value="5KUAMBYHLm6vyLgEwjLVx5bsQ6534c7mc54RoyaidJCfxBExdjf" placeholder="请输入账号私钥" /><br><br>
                                <input type="button" id="btn_keyLogin" value="确认登录"  />
                            </div>
                        </div>
                        
                        <div class="div_module_c" id="div_logout" pclass="class_1" >
                            <h2>退出登录</h2>
                            <div class="div_logout div_module">
                                <input type="button" id="btn_logout" value="确认退出" /><br><br>
                            </div>
                        </div>
                        <div class="div_module_c" id="div_changePassword" pclass="class_1" >
                            <h2>修改密码</h2>
                            <div class="div_changePassword div_module">
                               <p class="red">如果账户模式已经登录，该操作会创建子账户，创建该子账户需要操作账户为终身会员账户</p>
                               <input type="text" class="old_password" placeholder="原始密码/临时钱包密码" /><br><br>
                               <input type="text" class="new_password" placeholder="新密码" /><br><br>
                                <input type="button" id="btn_changePassword" value="确认修改"  /><br><br>
                            </div>
                        </div>
                        <div class="div_module_c" id="div_getUserInfo" pclass="class_1" >
                            <h2>获取当前账户信息</h2>
                            <div class="div_getUserInfo div_module">
                                <p>无callback,直接返回</p>
                                <input type="button" id="btn_getUserInfo" value="立即获取"  /><br><br>
                                <p class="res"></p>
                            </div>
                        </div>
                        <div class="div_module_c" id="div_createAccountWithPublicKey" pclass="class_11" >
                            <h2>公钥+账户名注册账户</h2>
                            <div class="div_createAccountWithPublicKey div_module">
                                <p class="red">如果账户模式已经登录，该操作会创建子账户，创建该子账户需要操作账户为终身会员账户</p>
                                用户名(规则/^[a-z][a-z0-9\.-]{4,63}$/)
                                <input type="text" class="accountName"  value="test1"><br><br>
                                owner public key(账户权限公钥)<input type="text" class="owner_public_key"  value=""><br><br>
                                active public key(资金权限公钥)<input type="text" class="active_public_key"  value=""><br><br>
                                <input type="button" class="btn_generateKey" value="随机生成公私钥"  /><br><br>
                                <p class="res_key"></p><br>
                                <input type="button" id="btn_createAccountWithPublicKey" value="确认"  /><br><br>
                                <p class="res"></p>
                            </div>
                        </div>

                        <div class="div_module_c" id="div_upgradeAccount" pclass="class_11" >
                            <h2>升级成为终身会员账户</h2>
                            <div class="div_upgradeAccount div_module">
                                <p>此操作需消耗一定的手续费</p>
                                <input type="button" id="btn_upgradeAccount" value="确认升级"  /><br><br>
                                <p class="res"></p>
                            </div>
                        </div>
                        <div class="div_module_c" id="div_witnessCreate" pclass="class_11" >
                            <h2>升级成为见证人账户</h2>
                            <div class="div_witnessCreate div_module">
                                url<input type="text" class="url"  value="http://cocos-terminal.com"><br><br>
                                区块签名公钥<input type="text" class="block_signing_key"  value=""><br><br>
                                <input type="button" id="btn_witnessCreate" value="确认升级"  /><br><br>
                                <p class="res"></p>
                            </div>
                        </div>
                        <div class="div_module_c" id="div_committeeMemberCreate" pclass="class_11" >
                            <h2>升级成为理事会账户</h2>
                            <div class="div_committeeMemberCreate div_module">
                                url<input type="text" class="url"  value="http://cocos-terminal.com"><br><br>
                                <input type="button" id="btn_committeeMemberCreate" value="确认升级"  /><br><br>
                                <p class="res"></p>
                            </div>
                        </div>
                        <div class="div_module_c" id="div_witnessUpdate" pclass="class_11" >
                            <h2>更新见证人信息</h2>
                            <div class="div_witnessUpdate div_module">
                                url<input type="text" class="new_url"  value="http://cocos-terminal.com"><br><br>
                                区块签名公钥<input type="text" class="new_signing_key"  value=""><br>
                                <div class="checkbox">
                                    工作状态:<input type="checkbox" class="work_status" style="width:auto;">          
                                </div>
                                <input type="button" id="btn_witnessUpdate" value="确认更新"  /><br>
                                <p class="res"></p>
                            </div>
                        </div>
                        <div class="div_module_c" id="div_committeeMemberUpdate" pclass="class_11" >
                            <h2>更新理事会信息</h2>
                            <div class="div_committeeMemberUpdate div_module">
                                url<input type="text" class="new_url"  value="http://cocos-terminal.com"><br>
                                <div class="checkbox">
                                    工作状态:<input type="checkbox" class="work_status" style="width:auto;">          
                                </div>
                                <input type="button" id="btn_committeeMemberUpdate" value="确认更新"  /><br>
                                <p class="res"></p>
                            </div>
                        </div>
                        <div class="div_module_c" id="div_getPrivateKey" pclass="class_11" >
                            <h2>获取私钥</h2>
                            <div class="div_getPrivateKey div_module">
                                <input type="button" id="btn_getPrivateKey" value="获取私钥"  /><br><br>
                                <p class="res"></p>
                            </div>
                        </div>
                        <div class="div_module_c" id="div_queryUserInfo" pclass="class_11" >
                            <h2>查询账户信息</h2>
                            <div class="div_queryUserInfo div_module">
                                account<input  type="text" class="account" value="test1"><br><br>
                                <input type="button" id="btn_queryUserInfo" value="立即查询"  /><br><br>
                                <p class="res"></p>
                            </div>
                        </div>

                        <div class="div_module_c" id="div_getOperations" pclass="class_11" >
                            <h2>查询和订阅账户记录</h2>
                            <div class="div_getOperations div_module" style="width:98%;">
                                account<input  type="text" class="account" value="test1"><br><br>
                                limit<input  type="text" class="limit" value="10"><br><br>
                                <input type="button" id="btn_getOperations" value="立即查询" /><br><br>
                                <table class="table">
                                    <thead>
                                        <tr>
                                            <th>区块</th>
                                            <th>操作</th>
                                            <th>信息</th>
                                            <th>手续费</th>
                                            <th>时间</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    </tbody>
                                </table>
                            </div>
                        </div>

                        <div class="div_module_c" id="div_transferAsset" pclass="class_2"  >
                            <h2>转账</h2>
                            <div class="div_transferAsset div_module">
                                <div class="div_from_account" style="display:none;">来自<input  type="text" class="from_account" value="test1"><br><br></div>
                                发往<input  type="text" class="to_account" value="test2"><br><br>
                                数量<input type="number" class="transfer_amount"  value="1"><br><br>
                                资产id<input type="text" class="asset_id"  value="COCOS"><br><br>
                                备注消息<input class="transfer_memo" type="text" value="">
                                <div class="checkbox">
                                    是否发起提议: <input type="checkbox"  class="isPropose" style="width:auto;" />          
                                </div>
                                <div class="checkbox">
                                    是否加密: <input type="checkbox" checked  class="isEncryption" style="width:auto;" />          
                                </div>
                                <input type="button" id="btn_transferAsset" value="转账"  /><br /><br />
                                <p class="res"></p>
                            </div>
                        </div>

                        <div class="div_module_c" id="div_createAsset" pclass="class_2"  >
                            <h2>资产创建</h2>
                            <div class="div_createAsset div_module">
                                资产符号<input  type="text" class="symbol" value="TEST"><br><br>
                                最大资产总量<input type="number" class="max_supply"  value="100000"><br><br>
                                精度(小数位数)<input type="number" class="precision"  value="5"><br><br>
                                <div class="checkbox">
                                     收取市场交易手续费:<input type="checkbox" class="is_charge_market_fee" style="width:auto;" />          
                                </div>
                               
                                <fieldset style="display:none" class="fieldset_charge_market_fee">
                                    <legend>交易手续费率 </legend>
                                    交易手续费率 (%)：<input type="text" class="market_fee_percent" value="1" />
                                    最大交易手续费：<input type="text" class="max_market_fee" value="1" />
                                </fieldset>
                                <br>
                                描述<textarea rows="6" class="description"></textarea>
                                <div class="checkbox">
                                    智能币 SmartCoin: <input type="checkbox" class="isBitAsset" style="width:auto;"  />          
                                </div>
                                <div class="div_bitassetOpts" >
                                    喂价有效时间（分钟）
                                    <input  type="text" class="feedLifetimeSec" value="1440"><br><br>
                                    最少喂价数量
                                    <input  type="text" class="minimumFeeds" value="1"><br><br>
                                    强制清算发生前延迟时间（分钟）
                                    <input  type="text" class="forceSettlementDelaySec" value="1440"><br><br>
                                    强制清算价格偏离百分比
                                    <input  type="text" class="forceSettlementOffsetPercent" value="1"><br><br>
                                    强制清算最大数量(百分比)
                                    <input  type="text" class="maximumForceSettlementVolume" value="20"><br><br>
                                    做空时可抵押的资产类型
                                    <input  type="text" class="shortBackingAsset" value="1.3.0"><br><br>                   
                                </div>
                               

                                <input type="button" id="btn_createAsset" value="确认创建"  />
                                <p class="res"></p>
                            </div>
                        </div>
                        <div class="div_module_c" id="div_updateAsset" pclass="class_2"  >
                            <h2>资产更新</h2>
                            <div class="div_updateAsset div_module">
                                资产符号<input  type="text" class="symbol" value="TEST"><br><br>
                                最大资产总量<input type="number" class="max_supply"  value="100000"><br><br>
                                新发行人<input type="text" class="new_issuer"  ><br><br>
                                <div class="checkbox">
                                  黑白名单: <input type="checkbox" class="white_list" style="width:auto;" checked />          
                                </div>
                                <div class="checkbox">
                                  限制交易: <input type="checkbox" class="transfer_restricted" style="width:auto;"  />          
                                </div>
                                <fieldset>
                                    <legend>GAS手续费汇率(只有GAS设置此项才有效)</legend>
                                    基准资产数量：<input type="text" class="base" value="" onKeyUp="_assets.u_priceChange()" />
                                    标价资产数量(COCOS)：<input type="text" class="quote" value="" onKeyUp="_assets.u_priceChange()" />
                                    <p>单价：<span class="price"></span></p>
                                </fieldset>
                                <br>
                                <div class="checkbox">
                                        收取市场交易手续费:<input type="checkbox" class="is_charge_market_fee" style="width:auto;" />          
                                </div>
                                <fieldset style="display:none" class="fieldset_charge_market_fee">
                                    <legend>交易手续费率 </legend>
                                    交易手续费率 (%)：<input type="text" class="market_fee_percent" value="1" />
                                    最大交易手续费：<input type="text" class="max_market_fee" value="1" />
                                </fieldset>
                                <br>
                                描述<textarea rows="6" class="description"></textarea><br><br>
                                <div class="checkbox">
                                    智能币 SmartCoin: <input type="checkbox" class="isBitAsset" style="width:auto;">          
                                </div>
                                <div class="div_bitassetOpts" >
                                    喂价有效时间（分钟）
                                    <input type="text" class="feedLifetimeSec" value="1440"><br><br>
                                    最少喂价数量
                                    <input type="text" class="minimumFeeds" value="1"><br><br>
                                    强制清算发生前延迟时间（分钟）
                                    <input type="text" class="forceSettlementDelaySec" value="1440"><br><br>
                                    强制清算价格偏离百分比
                                    <input type="text" class="forceSettlementOffsetPercent" value="1"><br><br>
                                    强制清算最大数量(百分比)
                                    <input type="text" class="maximumForceSettlementVolume" value="20"><br><br>
                                    做空时可抵押的资产类型
                                    <input type="text" class="shortBackingAsset" value="1.3.0"><br><br>                   
                                </div>
                                <input type="button" id="btn_updateAsset" value="确认更新"  /><br><br>
                                <p  class="res" ></p>
                            </div>
                        </div>
                        <div class="div_module_c" id="div_issueAsset" pclass="class_2"  >
                            <h2>资产发行</h2>
                            <div class="div_issueAsset div_module">
                                发行给<input  type="text" class="to_account" value="test2"><br><br>
                                发行数量<input type="number" class="amount"  value="10"><br><br>
                                资产符号<input type="text" class="asset_id"  value="TEST"><br><br>
                                备注消息<input class="memo" type="text" value="">
                                <div class="checkbox">
                                    是否加密: <input type="checkbox" checked  class="isEncryption" style="width:auto;" />          
                                </div>
                                <input type="button" id="btn_issueAsset" value="确认发行"  />
                                <p class="res"></p>
                            </div>
                        </div>
                        <div class="div_module_c" id="div_reserveAsset" pclass="class_2"  >
                            <h2>资产销毁</h2>
                            <div class="div_reserveAsset div_module">
                                资产符号<input  type="text" class="asset_id" value="TEST"><br><br>
                                销毁数量<input type="number" class="amount"  value="1"><br><br>
                                <input type="button" id="btn_reserveAsset" value="确认销毁"  /><br><br>
                                <p class="res"></p>
                            </div>
                        </div>
                        <div class="div_module_c" id="div_assetClaimFees" pclass="class_2"  >
                            <h2>资产手续费领取</h2>
                            <div class="div_assetClaimFees div_module">
                                资产符号<input  type="text" class="asset_id" value="TEST"><br><br>
                                数量<input type="number" class="amount"  value="1"><br><br>
                                <input type="button" id="btn_assetClaimFees" value="确认领取"  />
                                <p class="res"></p>

                            </div>
                        </div>
                        <div class="div_module_c" id="div_assetUpdateRestricted" pclass="class_2"  >
                            <h2>资产受限名单更新</h2>
                            <div class="div_assetUpdateRestricted div_module">
                                <p class="red">若是发行人与黑名单中的账户进行交易则不受限制</p>
                                资产符号<input  type="text" class="asset_id" value="TEST"><br><br>
                                <div class="checkbox">
                                 是否添加(否则移除,Boolean): <input type="checkbox" class="isadd" style="width:auto;" checked />          
                                </div>

                                限制类型(Number)<select class="restricted_type" >
                                    <option value ="1">资产权限账户白名单</option>
                                    <option value ="2">资产权限账户黑名单</option>
                                    <option value ="3">市场交易资产白名单</option>
                                    <option value ="4">市场交易资产黑名单</option>
                                </select><br><br>
                                限制列表(Array)<textarea rows="10" class="restricted_list">test3</textarea><br><br>

                                <input type="button" id="btn_assetUpdateRestricted" value="确认更新"  />
                                <p class="res"></p>
                            </div>
                        </div>

                        <div class="div_module_c" id="div_updateCollateralForGas" pclass="class_2"  >
                            <h2>为gas调整质押物</h2>
                            <div class="div_updateCollateralForGas div_module">
                                抵押人<input  type="text" class="mortgager" value="test1"><br><br>
                                受益人<input type="text" class="beneficiary"  value="test1"><br><br>
                                抵押数量<input type="number" class="collateral"  value="10"><br><br>
                                <div class="checkbox">
                                    是否发起提议: <input type="checkbox"  class="isPropose" style="width:auto;" />          
                                </div>
                                <p>预估获得gas：<span class="gas"></span></p>
                                <input type="button" id="btn_queryGas" value="确认获取预估gas"  /><br><br>
                                <input type="button" id="btn_updateCollateralForGas" value="确认"  />
                            </div>
                        </div>

                        <div class="div_module_c" id="div_queryAssetRestricted" pclass="class_2"  >
                            <h2>查询资产受限名单</h2>
                            <div class="div_queryAssetRestricted div_module">
                                资产符号<input  type="text" class="asset_id" value="TEST"><br><br>
                                限制类型<select class="restricted_type" >
                                    <option value ="0">所有类型</option>
                                    <option value ="1">资产权限白名单</option>
                                    <option value ="2">资产权限黑名单</option>
                                    <option value ="3">市场交易白名单</option>
                                    <option value ="4">市场交易黑名单</option>
                                </select><br><br>
                                <input type="button" id="btn_queryAssetRestricted" value="确认查询"  />
                                <p class="res"></p>
                            </div>
                        </div>
                        <div class="div_module_c" id="div_getAssets" pclass="class_2" >
                            <h2>查询链上发行的资产</h2>
                            <div class="div_getAssets div_module">
                                <input type="button" id="btn_getAssets" value="立即查询"  /><br><br>
                                <table class="table">
                                    <thead>
                                        <tr>
                                            <th>#</th>
                                            <th>资产</th>
                                            <th>发行人</th>
                                            <th>供应量</th>
                                        </tr>
                                    </thead>
                                    <tbody>

                                    </tbody>
                                </table>
                                <p>查询指定资产</p>
                                <input type="text" class="symbol" placeholder="请输入查询的资产符号" ><br><br>
                                <input type="button" id="btn_queryAsset" value="立即查询"  />
                                <div class="div_list">
                                  
                                </div>
                            </div>
                        </div>
                        <div class="div_module_c" id="queryAccountAllBalances" pclass="class_2" >
                            <h2>查询账户拥有的所有资产列表</h2>
                            <div class="div_queryAccountAllBalances div_module">
                                <h3>其中包含资产对记账单位的换算值</h3>
                                记账单位<input  type="text" class="asset_id" value=""><br><br>
                                account<input  type="text" class="account" value="test1"><br><br>
                                <input type="button" id="btn_queryAccountAllBalances" value="立即查询"  /><br><br>
                                <p class="res"></p>
                            </div>
                        </div>
                        
                        <div class="div_module_c" id="queryAccountBalances" pclass="class_2" >
                            <h2>查询账户指定资产</h2>
                            <div class="div_queryAccountBalances div_module">
                                资产id或symbol<input  type="text" class="asset_id" value=""><br><br>
                                account<input  type="text" class="account" value="test1"><br><br>
                                <input type="button" id="btn_queryAccountBalances" value="立即查询"  /><br><br>
                                <p class="res"></p>
                            </div>
                        </div>

                        <div class="div_module_c" id="div_registerCreator" pclass="class_3" >
                            <h2>注册开发者</h2>
                            <div class="div_registerCreator div_module">
                                <input type="button" id="btn_registerCreator" value="确认注册"  />
                            </div>
                        </div>
                        <div class="div_module_c" id="div_creatWorldView" pclass="class_3">
                            <h2>世界观创建</h2>
                            <div class="div_creatWorldView div_module">
                                世界观<input  type="text" class="world_view" value=""><br><br>
                                <input type="button" id="btn_creatWorldView" value="确认创建"  />
                            </div>
                        </div>
                        <div class="div_module_c" id="div_proposeRelateWorldView" pclass="class_3" > 
                            <h2>世界观提议关联</h2>
                            <div class="div_proposeRelateWorldView div_module">
                                <p>提议关联到某一个世界观，需要该世界观的创建人审批</p>
                                世界观<input  type="text" class="world_view" value="TEST"><br><br>
                                <input type="button" id="btn_proposeRelateWorldView" value="确认关联"  />
                            </div>
                        </div>
                        <div class="div_module_c" id="loadAccountProposals" pclass="class_3" >
                            <h2>查询账户收到的提议并审批</h2>
                            <div class="div_loadAccountProposals div_module" style="width:90%;">
                                account<input  type="text" class="account" value="test1"><br><br>
                                <input type="button" id="btn_loadAccountProposals" value="立即获取"  /><br><br>
                                <table class="table">
                                    <thead>
                                        <tr>
                                            <th>#</th>
                                            <th>id</th>
                                            <th>信息</th>
                                            <th>过期时间</th>
                                            <th>状态</th>
                                            <th>操作</th>
                                        </tr>
                                    </thead>
                                    <tbody>

                                    </tbody>
                                </table>
                            </div>
                        </div>
                        <div class="div_module_c" id="div_create_nh" pclass="class_3" >
                                <h2>NH资产创建</h2>
                                <div class="div_create_nh div_module">
                                    资产id<input  type="text" class="asset_id" value="COCOS" ><br><br>
                                    世界观<input  type="text" class="world_view" value="TEST" ><br><br>
                                    NH资产数据data<textarea rows="6" class="base_describe"></textarea><br><br>
                                    NH资产拥有者(NH资产归属权账户)<input  type="text" class="owner_account" value="test2" ><br><br>
                                    NH资产数量(默认为1)<input  type="text" class="nh_count" value="1" placeholder="" ><br><br><br>
                                    type(默认为0,可不传,如果批量创建不同NH资产传1)<input  type="text" class="type" value="0" placeholder="" ><br><br>
                                    批量创建不同NH资产(type为1才使用该参数)<textarea rows="6" class="items"></textarea><br><br><br>
                                    <input type="button" id="btn_create_nh" value="确认创建"  />
                                </div>
                            </div>    
                            <div class="div_module_c" id="div_deleteNHAsset" pclass="class_3" >
                                <h2>NH资产删除</h2>
                                <div class="div_deleteNHAsset div_module">
                                    itemIds(Array)<textarea rows="10" class="NHAssetIds">4.2.195,4.2.194</textarea><br><br><br>
                                    <input type="button" id="btn_deleteNHAsset" value="确认删除" >
                                </div>
                            </div>
                            <div class="div_module_c" id="div_transferNHAsset" pclass="class_3" >
                                <h2>NH资产转移</h2>
                                <div class="div_transferNHAsset div_module">
                                    转移目标账户<input  type="text" class="to_account" value="test2"><br><br>
                                    <input type="text" class="NHAssetIds"  value="4.2.2"><br><br>
                                    <input type="button" id="btn_transferNHAsset" value="确认发送"  />
                                </div>
                            </div>
                      
                        
                        <div class="div_module_c" id="div_sell" pclass="class_3">
                            <h2>NH资产出售单创建</h2>
                            <div class="div_creatNHAssetOrder div_module">
                                OTC交易平台账户otcAccount，用于收取挂单费用
                                <input  type="text" class="receiver" value="otcaccount" ><br><br>
                                挂单费用fee<input  type="text" class="token" value="1"><br><br>
                                挂单备注信息memo<input  type="text" class="memo" value="NH资产挂单"><br><br>
                                商品挂单价格price<input  type="text" class="price" value="2" ><br><br>
                                商品挂单价格币种priceAssetSymbol<input  type="text" class="priceAssetSymbol" value="1.3.0" ><br><br>
                                过期时间(即挂卖时间,number类型,如3600，表示3600秒后过期)<input  type="text" class="expiration" value="3600" ><br><br><br>

                                <!-- 游戏开发者账户<input  type="text" class="developerAccount" value="" ><br><br> -->
                                获取账户NH资产 <input type="button" id="btn_getAccountNHAssetForSell" value="立即获取"  /><br><br>     
                                NH资产itemID<select class="sel_goods" >
                                                <option value ="1">请选择您要卖的NH资产</option>
                                            </select>
                                <br><br><br>
                                
                                <p class="res"></p>
                                <input type="button" id="btn_creatNHAssetOrder" value="确认卖出NH资产"  />
                            </div>
                        </div>


                        <div class="div_module_c" id="div_queryNHAssets" pclass="class_5" >
                            <h2>查询NH资产详细信息</h2>
                            <div class="div_queryNHAssets div_module">
                                    hash或id<input  type="text" class="NHAssetHashOrIds" value="4.2.11" ><br><br>
                                <input type="button" id="btn_queryNHAssets" value="立即查询"  />
                                <p class="res"></p>
                            </div>
                        </div> 
                        <div class="div_module_c" id="div_queryAccountNHAssets" pclass="class_5" >
                            <h2>查询账户下所拥有的NH资产</h2>
                            <div class="div_queryAccountNHAssets div_module">
                                查询账户<input  type="text" class="account" value="test1" ><br><br>
                                查询的世界观<input  type="text" class="worldViews" value="" ><br><br>
                                page<input type="text" class="page" placeholder="" value="1" ><br><br>
                                pageSize<input type="text" class="pageSize" placeholder="" value="10" ><br><br>
                                <input type="button" id="btn_queryAccountNHAssets" value="立即查询"  />
                                <p class="res"></p>
                            </div>
                        </div> 
                        <div class="div_module_c" id="div_queryAccountNHAssetOrders" pclass="class_5" >
                            <h2>查询账户下的NH资产售卖单</h2>
                            <div class="div_queryAccountNHAssetOrders div_module"  style="width:98%;">
                                查询账户<input type="text" class="account" placeholder="" value="test1" ><br><br>
                                page<input type="text" class="page" placeholder="" value="1" ><br><br>
                                pageSize<input type="text" class="pageSize" placeholder="" value="10" ><br><br>
                                <input type="button" id="btn_queryAccountNHAssetOrders" value="立即查询" ><br><br>
                                <table class="table">
                                    <thead>
                                        <tr>
                                            <th>#</th>
                                            <th>订单id</th>
                                            <th>NH资产id</th>
                                            <th>基本属性</th>
                                            <th>域数据列表 </th>
                                            <th>售卖价格</th>
                                            <th>卖家</th>
                                            <th>过期时间</th>
                                            <th>备注</th>
                                            <th>操作</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    </tbody>
                                </table><br><br>
                            </div>
                        </div>
                        <div class="div_module_c" id="div_queryNHAssetOrders" pclass="class_5"  >
                            <h2>查询(购买)全网NH资产售卖单</h2>
                            <div class="div_queryNHAssetOrders div_module"  style="width:98%;">
                                资产ID或资产符号<input type="text" class="assetSymbolsOrIds" placeholder="" value="COCOS" ><br><br>
                                世界观ID或世界观名<input type="text" class="world_views" placeholder="" value="" ><br><br>
                                baseDescribe<input type="text" class="baseDescribe" placeholder="" value="" ><br><br>
                                page<input type="text" class="page" placeholder="" value="1" ><br><br>
                                pageSize<input type="text" class="pageSize" placeholder="" value="10" ><br><br>
                                <input type="button" id="btn_queryNHAssetOrders" value="立即查询" ><br><br>
                                <table class="table">
                                    <thead>
                                        <tr>
                                            <th>#</th>
                                            <th>订单id</th>
                                            <th>NH资产id</th>
                                            <th>基本属性</th>
                                            <th>域数据列表 </th>
                                            <th>售卖价格</th>
                                            <th>卖家</th>
                                            <th>过期时间</th>
                                            <th>备注</th>
                                            <th>操作</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    </tbody>
                                </table><br><br>
                            </div>
                        </div>
                        
                       
                        <div class="div_module_c" id="div_lookupWorldViews" pclass="class_5" >
                            <h2>查询世界观详细信息</h2>
                            <div class="div_lookupWorldViews div_module">
                                世界观<input  type="text" class="worldViewNameOrIds" value="TEST" ><br><br>
                                <input type="button" id="btn_lookupWorldViews" value="立即查询"  />
                                <p class="res"></p>
                            </div>
                        </div>
                        <div class="div_module_c" id="div_queryNHCreator" pclass="class_5" >
                            <h2>查询开发者关联的世界观</h2>
                            <div class="div_queryNHCreator div_module">
                                 查询账户名<input  type="text" class="account" value="test1" ><br><br>
                                 <p class="res"></p>
                                 <input type="button" id="btn_queryNHCreator" value="立即查询"  />
                            </div>
                        </div>
                        <div class="div_module_c" id="div_queryNHAssetsByCreator" pclass="class_5">
                            <h2>查询开发者所创建的NH资产</h2>
                            <div class="div_queryNHAssetsByCreator div_module">
                                查询账户名<input  type="text" class="account" value="test1" ><br><br>
                                page<input type="text" class="page" placeholder="" value="1" ><br><br>
                                pageSize<input type="text" class="pageSize" placeholder="" value="10" ><br><br>
                                <input type="button" id="btn_queryNHAssetsByCreator" value="立即查询"  />
                                <p class="res"></p>
                            </div>
                        </div>
                
                        <div class="div_module_c" id="div_getVotes"   pclass="class_8">
                                <h2>查询见证人理事会员投票信息数据并投票</h2>
                                <div class="div_getVotes div_module">
                                    类型<select class="type" >
                                        <option value ="witnesses">见证人</option>
                                        <option value ="committee">理事会</option>
                                    </select><br><br>
                                    查询投票账户<input  type="text" class="query_account" value=""><br><br>
                                    <input type="button" id="btn_getVotes" value="立即加载" /><br><br>
                                    <table class="table">
                                        <thead>
                                            <tr>
                                                <th>#</th>
                                                <th>账户名</th>
                                                <th>得票</th>
                                                <th>状态</th>
                                                <th>工作状态</th>
                                                <th style="text-align:center;">已支持</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                        </tbody>
                                    </table>
                                    <br><br>
                                    票数<input  type="text" class="votes" value=""><br><br>
                                    <input type="button" id="btn_publishVotes" value="保存修改" />
                                </div>
                            </div>
                            <div class="div_module_c" id="div_subscribeBlocks" pclass="class_7" >
                                <h2>订阅区块</h2>
                                <div class="div_subscribeBlocks div_module" style="width:90%;">
                                    <input type="button" id="btn_subscribeBlocks" value="立即订阅" /><br><br>
                                    <table class="table">
                                        <thead>
                                            <tr>
                                                <th>区块</th>
                                                <th>区块id</th>
                                                <th>见证人</th>
                                                <th>交易数</th>
                                                <th>时间</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                            <div class="div_module_c" id="div_subscribeToChainTranscation" pclass="class_7" >
                                <h2>订阅区块链交易</h2>
                                <div class="div_subscribeToChainTranscation div_module" style="width:90%;">
                                    <input type="button" id="btn_subscribeToChainTranscation" value="立即订阅" /><br><br>
                                    <table class="table">
                                        <thead>
                                            <tr>
                                                <th>区块</th>
                                                <th>操作</th>
                                                <th>信息</th>
                                                <th>手续费</th>
                                                <th>时间</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                            <div class="div_module_c" id="div_queryBlock" pclass="class_7" >
                                <h2>查询区块</h2>
                                <div class="div_queryBlock blockOrTXID div_module" style="width:90%;">
                                    block<input  type="text" class="block_num" value="362817" placeholder="查询区块或交易ID"><br><br>
                                    <input type="button" id="btn_queryBlock" value="立即查询" /><br><br>
                                    <div class="block listCard">
                                    </div>
                                    <div class="transactions">      
                                    </div>
                                </div>
                            </div>

                            <div class="div_module_c" id="div_queryTXID" pclass="class_7" >
                                <h2>查询交易</h2>
                                <div class="div_queryTXID blockOrTXID div_module" style="width:90%;">
                                     TXID<input  type="text" class="trx_id" value="1119f2fd778895add03887b738b2930081b12e0f" placeholder="查询区块或交易ID"><br><br>
                                    <input type="button" id="btn_queryTXID" value="立即查询" /><br><br>
                                    <div class="block listCard">
                                    </div>
                                    <div class="transactions">      
                                    </div>
                                </div>
                            </div>
                            <div class="div_module_c" id="div_queryDataByIds" pclass="class_7" >
                                <h2>查询数据通过id</h2>
                                <div class="div_queryDataByIds div_module" style="width:90%;">
                                     ids(Array)<input  type="text" class="ids" value="4.2.1" placeholder="查询区块或交易ID"><br><br>
                                    <input type="button" id="btn_queryDataByIds" value="立即查询" /><br><br>
                                    <p class="res"></p>
                                </div>
                            </div>

                            <div class="div_module_c" id="div_getWitnessesForExplorer" pclass="class_7" >
                                <h2>查看节点出块信息</h2>
                                <div class="div_getWitnessesForExplorer div_module" style="width:90%;" >
                                    <input type="button" id="btn_getWitnessesForExplorer" value="立即查看" /><br><br>
                                    <div class="mainInfo listCard">
    
                                    </div>
                                    <table class="table">
                                        <thead>
                                            <tr>
                                                <th>排名</th>
                                                <th>账户名</th>
                                                <th style="padding-right:20px; text-align:right;">上一个区块</th>
                                                <th>上次生成块</th>
                                                <th >缺失块数</th>
                                                <th >得票</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                        </tbody>
                                    </table>
                                </div>
                            </div>

                            <div class="div_module_c" id="div_queryVestingBalance"  pclass="class_7" >
                                <h2>查询可领取的解冻资产</h2>
                                <div class="div_queryVestingBalance div_module" >
                                    查询账户<input  type="text" class="account" value="unitedlabs.witness" placeholder="查询账户"><br><br>
                                    类型
                                    <select class="type">
                                       <option value="">全部</option>
                                        <option value="cashback_gas">gas领取</option>
                                        <option value="cashback_vb">gas抵押赎回</option>
                                        <option value="cashback_vote">投票抵押赎回</option>
                                        <option value="cashback_block">出块奖励领取</option>
                                    </select><br><br>
                                    <input type="button" id="btn_queryVestingBalance" value="立即查看" /><br><br>
                                    <div class="mainInfo">
    
                                    </div>
                                </div>
                            </div>

                            <div class="div_module_c" id="div_getWSNodeList" pclass="class_8"  >
                                <h2>查看API服务器节点列表+切换连接+删除节点</h2>
                                <div class="div_getWSNodeList div_module" style="width:90%;" >
                                    <input type="button" id="btn_getWSNodeList" value="立即获取" /><br><br>
                                    <p>当前使用的节点：<span class="selected_url"></span></p>
                                    <table class="table">
                                        <thead>
                                            <tr>
                                                <th>#</th>
                                                <th>名称</th>
                                                <th>url</th>
                                                <th>ping</th>
                                                <th>操作</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                        </tbody>
                                    </table>
                                </div>
                            </div>

                            <div class="div_module_c" id="div_addAPINode" pclass="class_8" >
                                <h2>添加API服务器节点</h2>
                                <div class="div_addAPINode div_module">
                                    名称<input  type="text" class="name" value="My node"><br><br>
                                    地址<input  type="text" class="address" value="ws://"><br><br>
                                    <input type="button" id="btn_addAPINode" value="确认添加" /><br><br>
                                </div>
                            </div>
                            <div class="div_module_c" id="div_subscribeToRpcConnectionStatus" pclass="class_8" >
                                <h2>监听与节点连接状态变化</h2>
                                <div class="div_subscribeToRpcConnectionStatus div_module">
                                    <input type="button" id="btn_subscribeToRpcConnectionStatus" value="确认监听" /><br><br>
                                    <p class="res"></p>
                                </div>
                            </div>   
                            <div class="div_module_c" id="div_disconnect" pclass="class_8" >
                                <h2>断开websoket通信</h2>
                                <div class="div_disconnect div_module">
                                    <input type="button" id="btn_disconnect" value="确认断开" /><br><br>
                                </div>
                            </div>    
                            <div class="div_module_c" id="div_generateKeys"  pclass="class_9" >
                                <h2>一键生成私钥/公钥（随机生成）</h2>
                                <div class="div_generateKeys div_module">
                                    <input type="button" id="btn_generateKeys" value="确认生成" /><br><br>
                                    <p>私钥：<span class="privateKey"></span></p>
                                    <p>公钥：<span class="publicKey"></span></p>
                                </div>
                            </div>
                            <div class="div_module_c" id="div_contract_create"  pclass="class_9" >
                                <h2>合约创建</h2>
                                <div class="div_contract_create div_module">
                                    合约权限(一对公私钥中的公钥publicKey)
                                    <input  type="text" class="authority" value="COCOS7d7RLEJc4tVYCskhKQLJHnJhhZQb4DWcTGqsWqFwC1mkxXvTY2"><br><br>
                                    合约名字name((规则/^[a-z][a-z0-9\.-]{4,63}$/))<input  type="text" class="name" value="contract.test02"><br><br>
                                    合约代码data<textarea rows="20" class="data"></textarea><br><br><br>
                                    <input type="button" id="btn_contract_create" value="确认创建合约" /><br><br>
                                </div>
                            </div>

                            <div class="div_module_c" id="div_updateContract"  pclass="class_9" >
                                <h2>合约更新</h2>
                                <div class="div_updateContract div_module">
                                    合约名字name((规则/^[a-z][a-z0-9\.-]{4,63}$/))<input  type="text" class="name" value="contract.test02"><br><br>
                                    合约代码data<textarea rows="20" class="data"></textarea><br><br><br>

                                    <input type="button" id="btn_update_contract" value="确认更新合约" /><br><br>
                                    <p class="res"></p>
                                </div>
                            </div>
                            
                            <div class="div_module_c"  id="div_call_contract_function"  pclass="class_9" >
                                <h2>合约接口调用</h2>
                                <div class="div_call_contract_function div_module">
                                    合约name或ID<input  type="text" class="nameOrId" value="contract.test02"><br><br>
                                    目标函数名<input  type="text" class="function_name" value="my_nht_describe_change"><br><br>
                                    参数列表 <textarea rows="10" class="value_list"></textarea><br><br>
                                    <input type="button" id="btn_call_contract_function" value="确认执行合约函数" /><br><br>
                                </div>
                            </div>
                    
                            <div class="div_module_c" id="div_get_contract"  pclass="class_9" >
                                <h2>查询合约信息</h2>
                                <div class="div_get_contract div_module">
                                    合约名字或ID<input  type="text" class="contract_nameOrId" value="contract.test02"><br><br>
                                    <input type="button" id="btn_get_contract" value="确认查询" /><br><br>
                                    <p >合约：<span class="contract_name"></span></p>
                                    <p >创建账户：<span class="account_name"></span></p>
                                    <p >创建时间：<span class="create_date"></span></p>
                                    <p >动作：<span class="actions"></span></p>
                                    <p> 合约接口描述：</p>
                                    <div class="actions_describe"> </div>
                                    <p> 合约数据：</p>
                                    <div class="contract_data"></div>
                                    <p> 合约数据类型：</p>
                                    <div class="contract_data_type"></div>
                                    <p>合约源代码:</p>
                                    <textarea class="txt_source_code" rows="30"></textarea><br><br>
                                </div>
                            </div>
                            <div class="div_module_c" id="div_getAccountContractData"  pclass="class_9" >
                                <h2>查询账户合约信息</h2>
                                <div class="div_getAccountContractData div_module">
                                    账户名或ID<input  type="text" class="account_nameOrId" value="test1"><br><br>
                                    合约名字或ID<input  type="text" class="contract_nameOrId" value="contract.test02"><br><br>
                                    <input type="button" id="btn_getAccountContractData" value="立即查询" /><br><br>
                                    <p >合约：<span class="contract_name"></span></p>
                                    <p >合约数据所属账户：<span class="account_name"></span></p>
                                    <p> 合约数据：</p>
                                    <div class="account_contract_data"> </div>
                                    <p> 合约数据类型：</p>
                                    <div class="account_contract_data_type"> </div>
                                    <br>
                                    <br>
                                </div>
                            </div>
                            <div class="div_module_c" id="div_assetSettle"  pclass="class_10" >
                                <h2>个人资产清算</h2>
                                <div class="div_assetSettle div_module">
                                    资产符号<input  type="text" class="assetId" value="TEST"><br><br>
                                    金额 <input  type="text" class="amount" value="2"><br><br>
                                    <input type="button" id="btn_assetSettle" value="确认清算" /><br><br>
                                    <p class="res"></p>
                                </div>
                            </div> 
                            <div class="div_module_c" id="div_assetGlobalSettle"  pclass="class_10" >
                                <h2>全局资产清算</h2>
                                <div class="div_assetGlobalSettle div_module">
                                    <p>全局清算根据当前提供的价格立即清算，个人清算是以资产设定的延迟清算时间到来时的喂价价格执行清算</p>
                                    资产符号<input  type="text" class="assetId" value="TEST"><br><br>
                                    价格(Number) <input  type="text" class="price" value="2"><br><br>
                                    <input type="button" id="btn_assetGlobalSettle" value="确认清算" /><br><br>
                                    <p class="res"></p>
                                </div>
                            </div> 
                            <div class="div_module_c" id="div_assetUpdateFeedProducers"  pclass="class_10" >
                                <h2>资产喂价提供者更新</h2>
                                <div class="div_assetUpdateFeedProducers div_module">
                                    资产符号<input  type="text" class="assetId" value="TEST"><br><br>
                                    喂价提供者账户(Array) <textarea rows="10" class="new_feed_producers">1.2.5</textarea><br><br>
                                    <input type="button" id="btn_assetUpdateFeedProducers" value="确认喂价" /><br><br>
                                    <p class="res"></p>
                                </div>
                            </div> 
                            <div class="div_module_c" id="div_assetPublishFeed"  pclass="class_10" >
                                <h2>资产喂价</h2>
                                <div class="div_assetPublishFeed div_module">
                                    资产符号<input  type="text" class="assetId" value="TEST"><br><br>
                                    价格(Number)<input  type="text" class="price" value="1"><br><br>
                                    维持抵押率(Number)<input  type="text" class="maintenance_collateral_ratio" value="1.75"><br><br>
                                    强制平仓比例上限(Number)<input  type="text" class="maximum_short_squeeze_ratio" value="1.5"><br><br>
                                    <input type="button" id="btn_assetPublishFeed" value="确认喂价" /><br><br>
                                    <p class="res"></p>
                                </div>
                            </div> 

                            <div class="div_module_c" id="div_callOrderUpdate"  pclass="class_10" >
                                <h2>抵押债仓</h2>
                                <div class="div_callOrderUpdate div_module">
                                    <p class="red">如果结算价格没有被清空,则不能进行借贷，要想清空结算价格，需要发布结算价格低"维持抵押率"倍数的价格</p>
                                    债务金额<input  type="text" class="debtAmount" value="100"><br><br>
                                    债务资产id<input  type="text" class="debtAssetId" value="STEST"><br><br>
                                    抵押物金额<input  type="text" class="collateralAmount" value="100"><br><br>
                                    抵押物资产id<input  type="text" class="collateralAssetId" value="1.3.0"><br><br>

                                    抵押率:<span class="span_ratio">1</span>&nbsp;&nbsp;&nbsp;最低抵押率：<span class="min_ratio"></span>
                                    <input type="range"  style="display:none;" class="ratio" step="0.1" min="0" max="6" value="1"><br><br>
                                    <span class="radio_msg"></span>
                                    <input type="button" id="btn_callOrderUpdate" value="调整债仓" /><br><br>

                                    账户<input  type="text" class="account" value="test1"><br><br>
                                    <input type="button" id="btn_queryDebt" value="查询当前债务" /><br><br>
                                    <p>喂价：<span class="feed_price"></span></p>
                                    <p>你的强平触发价：<span class="call_price"></span></p>
                                    <p>债务：<span class="debt"></span></p>
                                    <p>抵押物：<span class="collateral"></span></p>

                                    <p class="res"></p>
                                </div>
                            </div> 

                            <div class="div_module_c" id="div_createLimitOrder"  pclass="class_10" >
                                <h2>代币资产“限价单”交易</h2>
                                <div class="div_createLimitOrder div_module">
                                    交易对transactionPair(TEST_COCOS为买卖COCOS交易市场的TEST)
                                    <input  type="text" class="transactionPair" value="TEST_COCOS"><br><br>
                                    交易类型type(0:卖单，1:买单)<input  type="text" class="type" value="1"><br><br>
                                    价格price(单位为交易市场顶级资产,如COCOS)<input  type="text" class="price" value="0.26"><br><br>
                                    数量(单位如二级资产TEST)<input  type="text" class="amount" value="0.1"><br><br>
                                    <input type="button" id="btn_createLimitOrder" value="立即下单" /><br><br>
                                </div>
                            </div> 
                            <div class="div_module_c" id="div_subscribeToTransactionPair"  pclass="class_10" >
                                    <h2>查询&订阅市场交易对相关数据</h2>
                                    <div class="div_subscribeToTransactionPair div_module" style="width:96%;">
                                        交易对transactionPair(TEST_COCOS为买卖COCOS交易市场的TEST)
                                        <input  type="text" class="transactionPair" value="TEST_COCOS"><br>
                                        <div class="checkbox">
                                                是否订阅:<input type="checkbox" class="subscribe" style="width:auto;" />          
                                        </div>
                                        <input type="button" id="btn_subscribeToTransactionPair" value="立即查询" /><br><br>
                                        <div class="container">
                                            <div class="opt">
                                                  价格 <span class="price_unit"></span><input  type="text" class="price" value=""><br><br>  
                                                  数量 <span class="amount_unit"></span><input  type="text" class="amount" value=""><br><br>   
                                                  成交总额 <span class="turnover_unit"></span> <input  readonly type="text" class="turnover" value=""><br><br>   
                                                  手续费 <span class="fee_unit"></span><input  type="text" class="fee" value=""><br><br>   
                                                  <P class="buy_balances"></P>
                                                  <input type="button" class="btn btn_buy"  value="立即买入" style="background:green;"/><br><br>
                                                  <P class="sell_balances"></P>
                                                  <input type="button" class="btn btn_sell"  value="立即卖出" style="background:red;"/><br><br>
                                            </div>
                                            <div class="orders">
                                                <fieldset class="sell scroll">
                                                    <legend>卖单</legend>
                                                    <table class="table">
                                                            <thead>
                                                                <tr>
                                                                    <th>价格</th>
                                                                    <th>数量</th>
                                                                    <th>成交金额</th>
                                                                </tr>
                                                            </thead>
                                                            <tbody>
                                                            </tbody>
                                                     </table>
                                                </fieldset>
                                                <fieldset class="buy scroll">
                                                    <legend>买单</legend>
                                                    <table class="table">
                                                            <thead>
                                                                <tr>
                                                                    <th>价格</th>
                                                                    <th>数量</th>
                                                                    <th>成交金额</th>
                                                                </tr>
                                                            </thead>
                                                            <tbody>
                                                            </tbody>
                                                        </table>
                                                </fieldset>
                                            </div>
                                        </div>
                                        <fieldset class="myOrders scroll">
                                            <legend>我的委托</legend>
                                            <table class="table">
                                                <thead>
                                                    <tr>
                                                        <th>价格</th>
                                                        <th>数量</th>
                                                        <th>成交金额</th>
                                                        <th>过期时间</th>
                                                        <th>操作</th>
                                                    </tr>
                                                </thead>
                                                <tbody>
                                                </tbody>
                                            </table>
                                        </fieldset>
                                        <fieldset class="myHistory scroll">
                                            <legend>我的交易历史</legend>
                                            <table class="table">
                                                <thead>
                                                    <tr>
                                                        <th>价格</th>
                                                        <th>数量</th>
                                                        <th>成交金额</th>
                                                        <th>区块时间</th>
                                                    </tr>
                                                </thead>
                                                <tbody>
                                                </tbody>
                                            </table>
                                        </fieldset>
                                        <fieldset class="history scroll" >
                                            <legend>所有交易历史</legend>
                                            <table class="table">
                                                <thead>
                                                    <tr>
                                                        <th>价格</th>
                                                        <th>数量</th>
                                                        <th>成交金额</th>
                                                        <th>区块时间</th>
                                                    </tr>
                                                </thead>
                                                <tbody>
                                                </tbody>
                                            </table>
                                        </fieldset>
                                    </div>
                                </div> 
                            <div class="div_module_c" id="div_getMarketStats"  pclass="class_10" >
                                <h2>查询&订阅交易市场行情</h2>
                                <div class="div_getMarketStats div_module">
                                    交易市场<input  type="text" class="baseAsset" value="USDT"><br><br>
                                    相关交易对的币种<input  type="text" class="coins" value="COCOS,TEST"><br><br>
                                    <div class="checkbox">
                                         是否订阅:<input type="checkbox" class="subscribe" style="width:auto;" />          
                                    </div>
                                    <input type="button" id="btn_getMarketStats" value="立即查询" /><br><br>
                                    <table class="table">
                                        <thead>
                                            <tr>
                                                <th>#</th>
                                                <th>资产</th>
                                                <th>价格</th>
                                                <th>成交量</th>
                                                <th>涨跌幅</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                        </tbody>
                                    </table>
                                </div>
                            </div>   
                            <div class="div_module_c" id="div_queryPriceHistory"  pclass="class_10" >
                                <h2>查询交易对K线数据</h2>
                                <div class="div_queryPriceHistory div_module">
                                    交易对trx_symbol(TEST_USDT为买卖USDT交易市场的TEST)
                                    <input  type="text" class="trxSymbol" value="TEST_USDT"><br>
                                    周期(单位秒)<input  type="text" class="step" value="86400"><br><br>
                                    pageSize(返回数据条数)<input  type="text" class="pageSize" value="10"><br><br>
                                    page(第几页)<input  type="text" class="page" value="1"><br><br>

                                    <input type="button" id="btn_queryPriceHistory" value="立即查询" /><br><br>
                                </div>
                            </div>  
                            <div class="div_module_c" id="div_getTransactionBaseFee"  pclass="class_12" >
                                <h2>查询交易类型基础手续费</h2>
                                <div class="div_getTransactionBaseFee div_module">
                                    交易类型<input  type="text" class="transactionType" value="transfer"><br><br>
                                    手续费资产类型<input  type="text" class="feeAssetId" value="COCOS"><br><br>
                                    <input type="button" id="btn_getTransactionBaseFee" value="立即获取" /><br><br>
                                    <p class="res"></p>
                                </div>
                            </div> 
                            <div class="div_module_c" id="div_queryFees"  pclass="class_12" >
                                <h2>查询手续费集合</h2>
                                <div class="div_queryFees div_module">
                                    <input type="button" id="btn_queryFees" value="立即获取" /><br><br>
                                    <p class="res"></p>
                                </div>
                            </div> 
                            <div class="div_module_c" id="div_unsubscribe"  pclass="class_12" >
                                <h2>取消订阅</h2>
                                <div class="div_unsubscribe div_module">
                                    取消指定的订阅方法<input  type="text" class="method" value="subscribeToBlocks"><br><br>
                                    <input type="button" id="btn_unsubscribe" value="确认取消" /><br><br>
                                </div>
                            </div>
                            <div class="div_module_c" id="div_apiConfig"  pclass="class_12" >
                                <h2>API参数配置&获取</h2>
                                <div class="div_apiConfig div_module">
                                    语言<select class="lang" >
                                            <option value ="zh">简体中文</option>
                                            <option value ="en">english</option>
                                        </select>
                                    <div class="checkbox">
                                        实时订阅: <input type="checkbox" class="realSub" style="width:auto;" checked />          
                                    </div>
                                    <input type="button" id="btn_apiConfig" value="确认配置" /><br><br>
                                    <input type="button" id="btn_getApiConfig" value="获取API参数配置" /><br><br>
                                    <p class="res"></p>
                                </div>
                            </div>
                </div>
        </div>
       
    </div>

        <script src="./assets/bcx.min.js?v=7"></script>
        <script type="text/javascript" src="./FELib/jquery-1.8.3.min.js" charset="utf-8"></script>
        <script type="text/javascript" src="./FELib/jsonview/jquery.jsonview.min.js" charset="utf-8"></script>

        <script>
                function loadLeftNavs(){
                    var el_modules=document.querySelectorAll(".right_main_content .body .div_module_c");
                    var nav_htmls="";
                    var m_name="";
                    var el;
                    var p_class="";
                    for(var i=0;i<el_modules.length;i++){
                        el=el_modules[i];
                        m_name=el.querySelector("h2").innerText;
                        p_class=el.getAttribute("pclass");
                        if(p_class){
                           var li=document.createElement("LI"); 
                           li.innerHTML='<a href="#'+el.id+'">'+m_name+'</a>';
                           gel("."+p_class).appendChild(li); 
                        }
                    }
                }

                loadLeftNavs();
                
                // var _configParams={ 
                //     ws_node_list:[
                //          {url:"wss://test.cocosbcx.net",name:"Cocos - China - Beijing"}   
                //      ],
                //      networks:[
                //         {
                //             core_asset:"COCOS",
                //             chain_id:"1ae3653a3105800f5722c5bda2b55530d0e9e8654314e2f3dc6d2b010da641c5" 
                //         }
                //      ], 
                //      faucet_url:"https://test-faucet.cocosbcx.net",
                //      auto_reconnect:true,
                //      real_sub:true,
                //      check_cached_nodes_data:false
                //     //app_keys:["5HxzZncKDjx7NEaEv989Huh7yYY7RukcJLKBDQztXAmZYCHWPgd"]
                // };
                var _configParams={ 
                    ws_node_list:[
                      {url:"wss://api.cocosbcx.net",name:"Cocos - Terminal"}
                     ],
                     networks:[
                        {
                            core_asset:"COCOS",
                            chain_id:"6057d856c398875cac2650fe33caef3d5f6b403d184c5154abbff526ec1143c4" 
                        }
                     ], 
                     faucet_url:"https://faucet.cocosbcx.net",
                     auto_reconnect:true,
                     real_sub:true,
                     check_cached_nodes_data:false
                    //app_keys:["5HxzZncKDjx7NEaEv989Huh7yYY7RukcJLKBDQztXAmZYCHWPgd"]
                };

                var bcx=new BCX(_configParams);
                //可以不用初始化，直接调用，API会自动判断是否初始化，热没有初始化则自动初始化
                bcx.init({
                    real_sub:true,
                    subscribeToRpcConnectionStatusCallback:res=>{
                        console.info("subscribeToRpcConnectionStatusCallback res",res);
                    }
                }).then(res=>{
                    console.info("init res",res);
                    console.info("this.$bcx.getAccountInfo()",bcx.getAccountInfo());

                    _wallet.init();
                    _user.init();
                    _contracts.init();
                    _NHAssets.init();
                    _nodes.init();
                    _assets.init();
                    _explorer.init();
                    _market.init();
                    _others.init();
                });
                // bcx.subscribeToRpcConnectionStatus({
                //     callback:res=>{
                //         console.info("subscribeToRpcConnectionStatus res",res);
                //     }
                // })
                var _others={
                    init(){
                        gel("#btn_getVotes").onclick=this.queryVotes;
                        gel("#btn_publishVotes").onclick=this.publishVotes;

                        gel("#btn_getTransactionBaseFee").onclick=this.getTransactionBaseFee;
                        gel("#btn_queryFees").onclick=this.queryFees;

                        
                        gel("#btn_unsubscribe").onclick=this.unsubscribe;

                        gel("#btn_apiConfig").onclick=()=>{
                            bcx.apiConfig({
                                check_cached_nodes_data:false,
                                // worker:gel(".div_apiConfig .worker").value,
                                locale:gel(".div_apiConfig .lang").value,
                                real_sub:gel(".div_apiConfig .realSub").checked,
                                faucet_url:"http://47.93.62.96:8042"                            
                            },true).then(res=>{
                                console.info("apiConfig res",res);
                            })
                        }

                        gel("#btn_getApiConfig").onclick=()=>{
                            $(".div_apiConfig .res").JSONView(bcx.getApiConfig());
                            console.info("btn_getApiConfig res",bcx.getApiConfig());
                        }

                    },
                    queryFees(){
                        bcx.queryFees().then(res=>{
                            $(".div_queryFees .res").JSONView(res);
                        })
                    },
                    queryVotes(){
                        bcx.queryVotes({
                            queryAccount:gel(".div_getVotes .query_account").value,
                            type:gel(".div_getVotes .type").value
                        }).then(res=>{
                            console.info("getVotes res",res);
                            //(id:${item.account_id},vote_id:${item.vote_id})
                            if(res.code==1){
                                var votes_html=""
                                res.data.forEach(function(item,index){
                                    votes_html+=` <tr>
                                                    <th scope="row">${(index+1)}</th>
                                                    <td >${item.account_name}</td>
                                                    <td>${item.votes}</td>
                                                    <td>${item.active?"活跃":"不活跃"}</td>
                                                    <td>${item.work_status?"是":"否"}</td>
                                                    <td><input type="checkbox" ${item.supported?"checked":""} value="${item.account_id}" ></td>
                                                </tr>`
                                })
                                gel(".div_getVotes tbody").innerHTML=votes_html;
                            }
                        })
                    },
                    publishVotes(){
                        var vote_ids=[]
                        var checkboxs=document.querySelectorAll(".div_getVotes input[type=checkbox]")
                                      .forEach(function(item){
                                            if(item.checked){
                                            vote_ids.push(item.value);
                                            }
                                        })
                        let type=gel(".div_getVotes .type").value;
                        console.info("vote_ids",vote_ids,type);
                        bcx.publishVotes({
                            type,
                            vote_ids,
                            votes:gel(".div_getVotes .votes").value
                        }).then(res=>{
                            console.info("publishVotes res",res);
                        })
                    },
                    getTransactionBaseFee(){
                        bcx.queryTransactionBaseFee({
                            transactionType:gel(".div_getTransactionBaseFee .transactionType").value,
                            feeAssetId:gel(".div_getTransactionBaseFee .feeAssetId").value,
                            callback:function(res){
                                console.info("getTransactionBaseFee res",res);
                                $(".div_getTransactionBaseFee .res").JSONView(res);
                                
                            }
                        })
                    },
                    unsubscribe(){
                        bcx.unsubscribe({methods:gel(".div_unsubscribe .method").value.split(",")})//
                        .then(res=>{
                            console.info("unsubscribe res",res);
                        });
                    }
                }

                var _market={
                    init:function(){
                        gel("#btn_getMarketStats").onclick=this.getMarketStats;
                        gel("#btn_createLimitOrder").onclick=function(){
                            _market.createLimitOrder(gel(".div_createLimitOrder .type").value,
                            gel(".div_createLimitOrder .price").value,
                            gel(".div_createLimitOrder .amount").value,
                            gel(".div_createLimitOrder .transactionPair").value);
                        };
                        gel("#btn_subscribeToTransactionPair").onclick=this.subscribeToTransactionPair;
                        gel(".div_subscribeToTransactionPair .btn_buy").onclick=function(){
                            _market.createLimitOrder(1,
                            gel(".div_subscribeToTransactionPair .price").value,
                            gel(".div_subscribeToTransactionPair .amount").value,
                            gel(".div_subscribeToTransactionPair .transactionPair").value);
                        }
                        gel(".div_subscribeToTransactionPair .btn_sell").onclick=function(){
                            _market.createLimitOrder(0,
                            gel(".div_subscribeToTransactionPair .price").value,
                            gel(".div_subscribeToTransactionPair .amount").value,
                            gel(".div_subscribeToTransactionPair .transactionPair").value);
                        }
                        gel("#btn_queryPriceHistory").onclick=this.queryPriceHistory;

                        gel("#btn_assetPublishFeed").onclick=this.assetPublishFeed

                        gel("#btn_callOrderUpdate").onclick=this.callOrderUpdate;

                        gel("#btn_queryDebt").onclick=this.queryDebt;

                        gel(".ratio").onchange=(e)=>{
                            gel(".span_ratio").innerText=e.target.value;
                            gel(".collateralAmount").value=(gel(".debtAmount").value*
                            _market.debt_data.format_feed_price*e.target.value).toFixed(5);
                        }
                        
                        gel("#btn_assetUpdateFeedProducers").onclick=this.assetUpdateFeedProducers;

                        gel("#btn_assetGlobalSettle").onclick=this.assetGlobalSettle;

                        gel("#btn_assetSettle").onclick=this.assetSettle;  
                    },
                    debt_data:null,
                    queryDebt(){
                        bcx.queryDebt({
                            account:gel(".div_callOrderUpdate .account").value,
                            debtAssetId:gel(".div_callOrderUpdate .debtAssetId").value,
                            collateralAssetId:gel(".div_callOrderUpdate .collateralAssetId").value
                        }).then(res=>{
                            console.info("queryDebt res",res);
                            $(".div_callOrderUpdate .res").JSONView(res);

                            if(res.code==1){
                                let {call_price_text,collateral_value,debt_value,collateral_symbol,
                                    debt_symbol,format_feed_price_text,format_feed_price,maintenance_collateral_ratio}=res.data;
                                _market.debt_data=res.data;
                                gel(".div_callOrderUpdate .call_price").innerText=call_price_text;
                                gel(".div_callOrderUpdate .debt").innerText=debt_value+" "+debt_symbol;
                                gel(".div_callOrderUpdate .collateral").innerText=collateral_value+" "+collateral_symbol;
                                gel(".div_callOrderUpdate .feed_price").innerText=format_feed_price_text;

                                gel(".div_callOrderUpdate .collateralAmount").value=collateral_value;
                                gel(".div_callOrderUpdate .debtAmount").value=debt_value;
                                gel(".div_callOrderUpdate .debtAssetId").value=debt_symbol;
                                gel(".div_callOrderUpdate .collateralAssetId").value=collateral_symbol;
                                
                                gel(".min_ratio").innerText=maintenance_collateral_ratio;
                               if(Number(format_feed_price)){
                                gel(".div_callOrderUpdate .ratio").style.display="block";
                                let ratio=collateral_value/(debt_value*format_feed_price);
                                ratio=isNaN(Number(ratio))?0:ratio;
                                gel(".div_callOrderUpdate .ratio").value=ratio;
                                gel(".div_callOrderUpdate .span_ratio").innerText=ratio;
                               }else{
                                gel(".div_callOrderUpdate .ratio").style.display="none";
                                gel(".div_callOrderUpdate .span_ratio").innerText="无有"+debt_symbol+"效喂价"; 
                               }
                               
                            }
                        })
                    },
                    callOrderUpdate(){
                        if(gel(".collateralAmount").value/(_market.debt_data.format_feed_price*gel(".debtAmount").value)<1.75){
                            alert("抵押率低于要求的 1.75，不允许操作");
                            return;
                        }
                        bcx.callOrderUpdate({
                            collateralAmount:gel(".collateralAmount").value,
                            collateralAssetId:gel(".collateralAssetId").value,
                            debtAmount:gel(".debtAmount").value,
                            debtAssetId:gel(".debtAssetId").value
                        }).then(res=>{
                            console.info("callOrderUpdate res",res);
                            $(".div_callOrderUpdate .res").JSONView(res);
                        })
                    },
                    assetSettle(){
                        bcx.assetSettle({
                            assetId:gel(".div_assetSettle .assetId").value,
                            amount:gel(".div_assetSettle .amount").value
                        }).then(res=>{
                            console.info("assetSettle res",res);
                            $(".div_assetSettle .res").JSONView(res);
                        })
                    },
                    assetGlobalSettle(){
                        bcx.assetGlobalSettle({
                            assetId:gel(".div_assetGlobalSettle .assetId").value,
                            price:gel(".div_assetGlobalSettle .price").value
                        }).then(res=>{
                            console.info("assetGlobalSettle res",res);
                            $(".div_assetGlobalSettle .res").JSONView(res);
                        })
                    },
                    assetUpdateFeedProducers(){
                        bcx.assetUpdateFeedProducers({
                            assetId:gel(".div_assetUpdateFeedProducers .assetId").value,
                            newFeedProducers:(gel(".div_assetUpdateFeedProducers .new_feed_producers").value).split(",")
                        }).then(res=>{
                            console.info("assetUpdateFeedProducers res",res);
                            $(".div_assetUpdateFeedProducers .res").JSONView(res);
                        })
                    },
                    c_feedfeePriceChange(){
                        gel(".div_assetPublishFeed .fee_price").innerText=(gel(".div_assetPublishFeed .quote").value/
                        (gel(".div_assetPublishFeed .base").value||1)).toFixed(8)
                         +" COCOS/ "+gel(".div_assetPublishFeed .assetId").value
                    },
                    assetPublishFeed(){
                        bcx.assetPublishFeed({
                            assetId:gel(".div_assetPublishFeed .assetId").value,
                            price:gel(".div_assetPublishFeed .price").value,
                            maintenanceCollateralRatio:gel(".div_assetPublishFeed .maintenance_collateral_ratio").value,
                            maximumShortSqueezeRatio:gel(".div_assetPublishFeed .maximum_short_squeeze_ratio").value
                        }).then(res=>{
                            console.info("assetPublishFeed res",res);
                            $(".div_assetPublishFeed .res").JSONView(res);
                        })
                    },
                    queryPriceHistory(){
                        bcx.queryPriceHistory({
                            trxSymbol:gel(".div_queryPriceHistory .trxSymbol").value,
                            step:gel(".div_queryPriceHistory .step").value,
                            page:gel(".div_queryPriceHistory .page").value,
                            pageSize:gel(".div_queryPriceHistory .pageSize").value
                        }).then(res=>{
                            console.info("queryPriceHistory res",res);
                        })
                    },
                    setForm:function(index,type){
                        var order= _market.orders[type][index];
                        gel(".div_subscribeToTransactionPair .price").value=Number(order.price);
                        gel(".div_subscribeToTransactionPair .amount").value=Number(order.amount);
                        gel(".div_subscribeToTransactionPair .turnover").value=Number(order.turnover);
                    },
                    subscribeToTransactionPair:function(){
                        var trxPair=gel(".div_subscribeToTransactionPair .transactionPair").value;
                        var trxPairArr=trxPair.split("_");
                        gel(".div_subscribeToTransactionPair .price_unit").innerText=trxPairArr[1]+" / "+trxPairArr[0];
                        gel(".div_subscribeToTransactionPair .amount_unit").innerText=trxPairArr[0];
                        gel(".div_subscribeToTransactionPair .turnover_unit").innerText=trxPairArr[1]; 

                        bcx.queryTransactionBaseFee({
                            transactionType:"limit_order_create",
                            callback:res=>{
                                if(res.code==1){
                                    gel(".div_subscribeToTransactionPair .fee").value=res.data.fee_amount;
                                    gel(".div_subscribeToTransactionPair .fee_unit").innerText=res.data.fee_symbol;
                                }
                            }
                        });
                        
                        gel(".div_subscribeToTransactionPair .amount").onkeyup=e=>{
                            gel(".div_subscribeToTransactionPair .turnover").value=Number((e.target.value*gel(".div_subscribeToTransactionPair .price").value).toFixed(8));
                        }

                        bcx.queryTransactionPair({
                            transactionPair:trxPair,
                            subscribe:gel(".div_subscribeToTransactionPair .subscribe").checked,
                            hasMyTradeHistory:true,
                            callback:res=>{
                                console.info("subscribeToTransactionPair res",res);
                                
                                if(res.code==1){
                                    gel(".div_subscribeToTransactionPair .sell tbody").innerHTML="";
                                    gel(".div_subscribeToTransactionPair .buy tbody").innerHTML="";

                                    _market.orders=res.data.orders;
                                    res.data.orders.sell.forEach((order,index)=>{
                                        let {turnover,turnover_unit,amount,amount_unit,price,price_unit}=order;
                                        gel(".div_subscribeToTransactionPair .sell tbody").innerHTML+=`
                                            <tr class="animated fadeIn"  onclick="_market.setForm(${index},'sell')">
                                                <td>${price+" "+price_unit}</td>
                                                <td>${amount+" "+amount_unit}</td>
                                                <td >${turnover+" "+turnover_unit}</td>
                                            </tr>`
                                    })

                                    res.data.orders.buy.forEach((order,index)=>{
                                        let {turnover,turnover_unit,amount,amount_unit,price,price_unit}=order;
                                        gel(".div_subscribeToTransactionPair .buy tbody").innerHTML+=`
                                            <tr class="animated fadeIn" onclick="_market.setForm(${index},'buy')">
                                                <td>${price+" "+price_unit}</td>
                                                <td>${amount+" "+amount_unit}</td>
                                                <td >${turnover+" "+turnover_unit}</td>
                                            </tr>`
                                    })

                                    gel(".div_subscribeToTransactionPair .myOrders tbody").innerHTML="";

                                    res.data.my_orders.forEach((order,index)=>{
                                        let {turnover,turnover_unit,amount,amount_unit,
                                            price,price_unit,type,expiration,order_id}=order;
                                        
                                        gel(".div_subscribeToTransactionPair .myOrders tbody").innerHTML+=`
                                            <tr class="animated fadeIn" >
                                                <td class="${type=='buy'?'green':'red'}">${price+" "+price_unit}</td>
                                                <td>${amount+" "+amount_unit}</td>
                                                <td >${turnover+" "+turnover_unit}</td>
                                                <td >${expiration}</td>
                                                <td ><a href="javascript:_market.cancelLimitOrder('${order_id}')">取消</a></td>
                                            </tr>    
                                            `
                                    })
                                    
                                    gel(".div_subscribeToTransactionPair .history tbody").innerHTML="";

                                    res.data.last_trade_history.forEach((order,index)=>{
                                        let {turnover,turnover_unit,amount,amount_unit,
                                            price,price_unit,type,block_time}=order;

                                        gel(".div_subscribeToTransactionPair .history tbody").innerHTML+=`
                                            <tr >
                                                <td class="${type=='buy'?'green':'red'}">${price+" "+price_unit}</td>
                                                <td>${amount+" "+amount_unit}</td>
                                                <td >${turnover+" "+turnover_unit}</td>
                                                <td >${block_time}</td>
                                            </tr>    
                                            `
                                    })

                                    gel(".div_subscribeToTransactionPair .myHistory tbody").innerHTML="";

                                    res.data.my_last_trade_history.forEach((order,index)=>{
                                        let {turnover,turnover_unit,amount,amount_unit,
                                            price,price_unit,type,block_time}=order;

                                        gel(".div_subscribeToTransactionPair .myHistory tbody").innerHTML+=`
                                            <tr >
                                                <td class="${type=='buy'?'green':'red'}">${price+" "+price_unit}</td>
                                                <td>${amount+" "+amount_unit}</td>
                                                <td >${turnover+" "+turnover_unit}</td>
                                                <td >${block_time}</td>
                                            </tr>`
                                    })

                                    var account=gel(".current_account").innerText;
                                    if(account)
                                    bcx.queryAccountBalances({
                                        account
                                    }).then(res=>{
                                        if(res.code==1){
                                            gel(".buy_balances").innerText=trxPairArr[1]+"余额："+res.data[trxPairArr[1]];
                                            gel(".sell_balances").innerText=trxPairArr[0]+"余额："+res.data[trxPairArr[0]];
                                        }
                                    })
                                }  
                            }
                        })
                    },
                    getMarketStats:function(){
                        bcx.queryMarketStats({
                            baseAsset:gel(".div_getMarketStats .baseAsset").value,
                            quoteAssets:gel(".div_getMarketStats .coins").value.split(","),
                            subscribe:gel(".div_getMarketStats .subscribe").checked,
                            assetCache:false,
                            callback:function(res){
                                console.info("getMarketStats res",res);
                                if(res.code==1){
                                    gel(".div_getMarketStats tbody").innerHTML="";
                                    res.data.forEach((item,index)=>{
                                        let {quote_symbol,base_symbol,latest_price,volume_base,volume_quote,change}=item;
                                        let changeClass=Number(change)!=0?(Number(change)>0?"green":"red"):"";
                                        gel(".div_getMarketStats tbody").innerHTML+=`<tr>
                                                <th >${(index+1)}</th>
                                                <td >${quote_symbol}</td>
                                                <td>${latest_price} ${base_symbol+"/"+quote_symbol}</td>
                                                <td>${volume_quote} ${quote_symbol}</td>
                                                <td class="${changeClass}">${Number(change)>0?"+":""} ${change}%</td>
                                        </tr>`
                                    })
                                }
                            }
                        });
                  },
                  createLimitOrder:function(type,price,amount,transactionPair){
                      bcx.createLimitOrder({
                        transactionPair,
                        type,
                        price,
                        amount,
                        callback:function(res){
                            console.info("createLimitOrder res",res);
                        }
                      })
                  },
                  cancelLimitOrder:function(orderId){
                      bcx.cancelLimitOrder({
                         orderId,
                         callback:function(res){
                             console.info("cancelLimitOrder res",res);
                         }
                      })
                  }
                }

                var _explorer={
                    init:function(){
                        gel("#btn_queryBlock").onclick=this.queryBlock;
                        gel("#btn_queryTXID").onclick=this.queryTXID;
                        gel("#btn_queryDataByIds").onclick=this.queryDataByIds;  

                        gel("#btn_subscribeToChainTranscation").onclick=this.subscribeToChainTranscation;
                        gel("#btn_subscribeBlocks").onclick=this.subscribeBlocks;
                        gel("#btn_getWitnessesForExplorer").onclick=this.getWitnessesForExplorer;
                        gel("#btn_queryVestingBalance").onclick=this.queryVestingBalance;


                    },
                    queryDataByIds:function(){
                        bcx.queryDataByIds({
                            ids:gel(".div_queryDataByIds .ids").value.split(",")
                        }).then(res=>{
                            console.info("queryDataByIds res",res);
                            if(res.code==1)
                            $(".div_queryDataByIds .res").JSONView(res);
                        })
                    },
                    allOps:[],
                    subscribeToChainTranscation:function(){
                        bcx.subscribeToChainTranscation({
                            callback:function(res){
                                console.info("subscribeToChainTranscation res",res);
                                if(res.code==1){
                                    _explorer.allOps.unshift(res.data);
                                    if( _explorer.allOps.length>20){
                                        _explorer.allOps.length=20;
                                    }
                                    renderOp(_explorer.allOps,".div_subscribeToChainTranscation tbody",true);
                                }
                            }
                        })
                    },
                    blocks:[],
                    subscribeBlocks:function(){
                        bcx.subscribeToBlocks({
                            isReqTrx:false,
                            callback:function(res){
                                console.info("subscribeBlocks res",res);
                                if(res.code==1){
                                    _explorer.blocks.unshift(res.data);
                                    if(_explorer.blocks.length>20){
                                        _explorer.blocks.length=20; 
                                    }
                                    var blocks_html="";
                                    _explorer.blocks.forEach(function(block){
                                        var {block_height,block_id,trx_count,witness_name,time}=block;
                                        blocks_html+=`<tr   >
                                                        <td scope="row" width="80">${block_height}</th>
                                                        <td width="100" style="padding-right:10px;" >${block_id}</td>
                                                        <td>${witness_name}</td>
                                                        <td width="100" >${trx_count}</td>
                                                        <td>${time}</td>
                                                    </tr>`
                                    })
                                    gel(".div_subscribeBlocks tbody").innerHTML=blocks_html;
                                }
                            }
                        })
                    },
                    queryTXID:function(){
                        bcx.queryTransaction({
                            transactionId:gel(".div_queryTXID .trx_id").value
                        }).then(res=>{
                            console.info("queryTXID res",res);
                            if(res.code!=1){
                                return;
                            }

                            var trx=res.data;
                            _explorer.transaction=trx;
                            var block_htmls=`<div class="row trx_id">
                                                <div class="field">交易hash：</div><div class="value">${trx.trx_id}</div>
                                            </div>
                                            <div class="row date">
                                                <div class="field">过期时间：</div><div class="value">${trx.expiration}</div>
                                            </div>
                                            <div class="row block_id">
                                                <div class="field">所在区块：</div><div class="value">${trx.block_num}</div>
                                            </div>`

                            gel(".div_queryTXID .block").innerHTML=block_htmls;
                            gel(".div_queryTXID .transactions").innerHTML="";
                            let row_txid=document.createElement("div");
                            trx.parse_ops.forEach((op,op_index)=>{
                                more="";
                                if(op.result){
                                    var results="";
                                    if(op.result.type=="contract_result")
                                        op.result.contract_affecteds.forEach(c_op=>{
                                            results+="<p>"+c_op.parse_operations_text+"</p>"
                                        });

                                    if(op.result.type=="error_result")  results= op.result.message; 
                                    
                                    if(results)        
                                    more=`
                                    <a class="more" href="javascript:_explorer.showTXIDOpMore(${op_index});"  >查看结果</a>
                                    <div class="op_results">
                                        ${results}
                                    </div>
                                    `
                                }

                                var row_op=document.createElement("div");
                                row_op.id="a_"+trx.trx_id+"_"+op_index;
                                row_op.className="row_op";
                                row_op.innerHTML=`<div class="type">
                                                ${op.type_name}
                                            </div>
                                            <div class="info">
                                                ${op.parse_operations_text}
                                                ${more}
                                            </div>
                                            <div class="time">
                                                ${op.date}
                                            </div>`;

                                if(op.raw_data.new_options){
                                    var new_options_html=document.createElement("div");
                                    new_options_html.innerHTML='<span class="green" >新的设定</span>';
                                    new_options_html.className="new_options";

                                    var new_options_json_div=document.createElement("div");
                                    $(new_options_json_div).JSONView(op.raw_data.new_options,{ collapsed: true });
                                    new_options_html.appendChild(new_options_json_div);
                                    row_op.querySelector(".info").appendChild(new_options_html)
                                }

                                
                                row_txid.appendChild(row_op);
                            });

                             gel(".div_queryTXID .transactions").appendChild(row_txid);
                        });
                    },
                    queryBlock:function(){
                        bcx.queryBlock({
                            block:gel("#div_queryBlock .block_num").value,
                            callback:res=>{
                                console.info("queryBlock res",res);
                                if(res.code!=1){
                                    return;
                                }
                                var block=res.data;
                                var block_htmls=`
                                        <div class="row block_height">
                                            <div class="field">区块高度：</div><div class="value">${block.block_height}</div>
                                        </div>
                                        <div class="row date">
                                            <div class="field">日期：</div><div class="value">${block.time}</div>
                                        </div>
                                        <div class="row block_id">
                                            <div class="field">区块 hash：</div><div class="value">${block.block_id}</div>
                                        </div>
                                        <div class="row last_block_id">
                                            <div class="field">上一区块：</div><div class="value">${block.previous}</div>
                                        </div>
                                        <div class="row">
                                            <div class="field">生产者：</div><div class="value">${block.witness_name}</div>
                                        </div>
                                        <div class="row">
                                            <div class="field">交易数量：</div><div class="value">${block.trx_count}</div>
                                        </div>`
                                gel(".div_queryBlock .block").innerHTML=block_htmls;
                                
                                var trxs=block.transactions;
                                gel(".div_queryBlock .transactions").innerHTML="";
                                _explorer.transactions=trxs;
                                var row_txid,ops;
                                trxs.forEach((trx,trx_index)=>{
                                    ops=trx.parse_ops;

                                    row_txid=document.createElement("div")
                                    row_txid.innerHTML=`<h4>交易Hash: <span>${trx.trx_id}</span></h4>`;
                                    ops.forEach((op,op_index)=>{
                                        more="";
                                        
                                        if(op.result){
                                            var results="";
                                            if(op.result.type=="contract_result")
                                                op.result.contract_affecteds.forEach(c_op=>{
                                                    results+="<p>"+c_op.parse_operations_text+"</p>"
                                                });
        
                                            if(op.result.type=="error_result")  results= op.result.message; 
                                            
                                            if(results)    
                                            more=`
                                            <a class="more" href="javascript:_explorer.showTXIDOpMore(${op_index});"  >查看结果</a>
                                            <div class="op_results">
                                                ${results}
                                            </div>
                                            `
                                        }
    
                                        var row_op=document.createElement("div");
                                        row_op.id="a_"+op.block_num+"_"+op_index;
                                        row_op.className="row_op";
                                        row_op.innerHTML=`<div class="type">
                                                        ${op.type_name}
                                                    </div>
                                                    <div class="info">
                                                        ${op.parse_operations_text}
                                                        ${more}
                                                    </div>
                                                    <div class="time">
                                                        ${op.date}
                                                    </div>`;

                                        if(op.raw_data.new_options){
                                            var new_options_html=document.createElement("div");
                                            new_options_html.innerHTML='<span class="green" >新的设定</span>';
                                            new_options_html.className="new_options";
                                            var new_options_json_div=document.createElement("div");
                                            $(new_options_json_div).JSONView(op.raw_data.new_options,{ collapsed: true });

                                            new_options_html.appendChild(new_options_json_div);

                                            row_op.querySelector(".info").appendChild(new_options_html)
                                        }

                                        row_txid.appendChild(row_op);   
                                    })
                                    gel(".div_queryBlock .transactions").appendChild(row_txid);
                                });
                            }
                        })
                    },
                    showBlockOpMore:function(op_index,trx_index){
                        var operation=_explorer.transactions[trx_index].parse_ops[op_index];
                        console.info("operation",operation);
                        var op_el_id_selector="#a_"+operation.block_num+"_"+trx_index;//".div_queryBlockTXID .op_"+operation.id.replace(/\./g,"");
                        operation.expand=!!operation.expand;
                        gel(op_el_id_selector+" .op_results").style.display=operation.expand?"none":"block";
                        gel(op_el_id_selector+" .more").innerText=operation.expand?"查看结果":"收起"; 
                        operation.expand=!operation.expand;      
                    },
                    showTXIDOpMore:function(op_index){
                        var operation=_explorer.transaction.parse_ops[op_index];
                        console.info("operation",operation);
                        var op_el_id_selector="#a_"+_explorer.transaction.trx_id+"_"+op_index;//".div_queryBlockTXID .op_"+operation.id.replace(/\./g,"");
                        operation.expand=!!operation.expand;
                        gel(op_el_id_selector+" .op_results").style.display=operation.expand?"none":"block";
                        gel(op_el_id_selector+" .more").innerText=operation.expand?"查看结果":"收起"; 
                        operation.expand=!operation.expand;  
                    },
                    getWitnessesForExplorerTimer:0,
                    getWitnessesForExplorer:function(){
                        clearTimeout(_explorer.getWitnessesForExplorerTimer);
                        bcx.lookupWitnessesForExplorer({
                            callback:function(res){
                                console.info("getWitnessesForExplorer res",res);
                                if(res.code==1){
                                    let {active_witnesses,current_witness_name,participation,core_asset_symbol,
                                        witness_pay_per_block,witness_budget,next_maintenance_time}=res.data;
                                        next_maintenance_time=Math.ceil((new Date(next_maintenance_time).getTime()-Date.now())/1000/60)+"分钟后";
                                
                                    var mainInfoHtmls=`
                                    <div class="row">
                                        <div class="field">当前见证人：</div><div class="value">${current_witness_name}</div>
                                    </div>
                                    <div class="row">
                                        <div class="field">活跃见证人：</div><div class="value">${active_witnesses.length}</div>
                                    </div>
                                    <div class="row">
                                        <div class="field">参与率：</div><div class="value">${participation}%</div>
                                    </div>
                                    <div class="row">
                                        <div class="field">每块奖励：</div><div class="value">${witness_pay_per_block} ${core_asset_symbol}</div>
                                    </div>
                                    <div class="row">
                                        <div class="field">剩余预算：</div><div class="value">${witness_budget} ${core_asset_symbol}</div>
                                    </div>
                                    <div class="row">
                                        <div class="field">投票更新时间：</div><div class="value">${next_maintenance_time}</div>
                                    </div>
                                    `;
                                    gel(".div_getWitnessesForExplorer .mainInfo").innerHTML=mainInfoHtmls;

                                    var witnesses_htmls="";
                                    res.data.witnesses.forEach((witness,index)=>{
        
                                        let {account_name,last_confirmed_block_num,total_missed,votes,last_aslot_time}=witness;
                                        last_aslot_time=_helper.getTimeTo(last_aslot_time)

                                        let activeNodeClass=account_name==current_witness_name?'activeNodeClass':'';
                                        witnesses_htmls+=`<tr class="${activeNodeClass}">
                                                <td>${index+1}</td>
                                                <td>${account_name}</td>
                                                <td style="padding-right:20px; text-align:right;">${last_aslot_time} </td>
                                                <td>${last_confirmed_block_num}</td>
                                                <td>${total_missed}</td>
                                                <td>${votes}</td>
                                            </tr>`
                                    })
                                    gel(".div_getWitnessesForExplorer tbody").innerHTML=witnesses_htmls;
                                }
                                
                                _explorer.getWitnessesForExplorerTimer=setTimeout(() => {
                                    _explorer.getWitnessesForExplorer();
                                }, 1000);
                            }
                        });
                   },
                   claimVestingBalance(id,amount,asset_id){
                        bcx.claimVestingBalance({
                            id,
                            amount
                        }).then(res=>{
                            console.info("claimVestingBalance res",res);
                        })
                   },
                   queryVestingBalance(){
                        bcx.queryVestingBalance({
                            type:gel(".div_queryVestingBalance .type").value,
                            account:gel(".div_queryVestingBalance .account").value,
                            callback:function(res){
                                console.info("queryVestingBalance res",res);
                                if(res.code==1){
                                    let types={
                                        "cashback_gas":"gas领取",
                                        "cashback_block":"出块奖励领取",
                                        "cashback_vb":"gas抵押赎回",
                                        "cashback_vote":"投票抵押赎回"
                                    }
                                    let return_cashs={
                                        "cashback_gas":"恢复量",
                                        "cashback_block":"解冻奖励",
                                        "cashback_vb":"赎回量",
                                        "cashback_vote":"赎回量"
                                    }

                                    let available_balances={
                                        "cashback_gas":"剩余恢复时间",
                                        "cashback_block":"剩余解冻时间",
                                        "cashback_vb":"剩余赎回时间",
                                        "cashback_vote":"剩余赎回时间"
                                    }

                                    var mainInfoHtmls="";
                                    res.data.forEach(item=>{
                                        let {id,type,return_cash,earned_coindays,require_coindays,remaining_hours,available_percent,available_balance}=item;
                                        let {amount,symbol,asset_id}=available_balance;
                                        mainInfoHtmls+=`<div class="listCard">
                                            <div class="row">
                                                <div class="field">类型：</div><div class="value">${types[type]}</div>
                                            </div>
                                            <div class="row">
                                                <div class="field">${return_cashs[type]}：</div><div class="value">${return_cash} ${symbol}</div>
                                            </div>
                                            <div class="row">
                                                <div class="field">${available_balances[type]}：</div><div class="value">${remaining_hours} 小时</div>
                                            </div>
                                            <div class="row">
                                                <div class="field">可领取数量：</div><div class="value">${available_percent}% / <span class="amount">${amount}</span> ${symbol}</div>
                                            </div>

                                            <div class="row" dis>
                                                <input type="button" onClick="_explorer.claimVestingBalance('${id}',${amount})" value="立即领取" /><br><br>  
                                            </div>
                                        </div>
                                        `;
                                    })
                                    
                                    gel(".div_queryVestingBalance .mainInfo").innerHTML=mainInfoHtmls;
                                }
                            }
                        })
                    }
                }

               var _assets={
                    init:function(){
                        gel(".div_createAsset .is_charge_market_fee").onclick=this.charge_market_fee_change;
                      
                        gel(".div_updateAsset .is_charge_market_fee").onclick=this.updateAsset_charge_market_fee_change;

                        gel(".div_createAsset .isBitAsset").onclick=this.isBitAssetChange;
                        
                        gel(".div_updateAsset .isBitAsset").onclick=(e)=>{
                            gel(".div_updateAsset .div_bitassetOpts").style.display=e.target.checked?"block":"none";
                        };


                        gel("#btn_createAsset").onclick=function(){
                            _assets.createAsset(false);
                        }

                        gel("#btn_updateAsset").onclick=function(){
                            _assets.updateAsset();
                        }

                        
                        gel("#btn_getAssets").onclick=function(){
                            _assets.queryAssets();
                        };
                        gel("#btn_queryAsset").onclick=function(){
                            _assets.queryAssets(gel(".div_getAssets .symbol").value);
                        }

                        gel("#btn_transferAsset").onclick=function(){
                            _assets.transferAsset();
                        };
                   
                        gel("#btn_issueAsset").onclick=function(){
                            _assets.issueAsset(false);
                        }


                        gel("#btn_reserveAsset").onclick=function(){
                            _assets.reserveAsset();
                        }


                        gel("#btn_assetClaimFees").onclick=function(){
                            _assets.assetClaimFees(false);
                        }

                        
                        gel("#btn_queryAccountAllBalances").onclick=this.queryAccountAllBalances;
                       
                        gel("#btn_queryAccountBalances").onclick=this.getAccountBalances;

                        gel(".div_transferAsset .isPropose").onclick=function(e){
                            var isPropose=e.target.checked;
                            gel('.div_from_account').style.display=isPropose?'block':'none'
                        }
                        

                        gel("#btn_assetUpdateRestricted").onclick=_assets.assetUpdateRestricted

                        gel("#btn_queryAssetRestricted").onclick=this.queryAssetRestricted;

                        gel("#btn_queryGas").onclick=this.queryGas;
                        gel("#btn_updateCollateralForGas").onclick=this.updateCollateralForGas;
                    },
                    queryGas(){
                        bcx.queryGas({
                            amount:gel(".div_updateCollateralForGas .collateral").value
                        }).then(res=>{
                            console.info("queryGas res",res);
                            if(res.code==1){
                                let {amount,amount_symbol}=res.data;
                                gel(".div_updateCollateralForGas .gas").innerText=amount+" "+amount_symbol;
                            }
                        })
                    },
                    updateCollateralForGas(){
                        bcx.updateCollateralForGas({
                            mortgager:gel(".div_updateCollateralForGas .mortgager").value,
                            beneficiary:gel(".div_updateCollateralForGas .beneficiary").value,
                            amount:gel(".div_updateCollateralForGas .collateral").value,
                            isPropose:gel(".div_updateCollateralForGas .isPropose").checked
                        }).then(res=>{
                            console.info("updateCollateralForGas res",res);
                            if(res.code==1){

                            }
                        })
                    },
                    queryAssetRestricted(){
                        bcx.queryAssetRestricted({
                            assetId:gel(".div_queryAssetRestricted .asset_id").value,
                            restrictedType:gel(".div_queryAssetRestricted .restricted_type").value,
                        }).then(res=>{
                            console.info("queryAssetRestricted res",res);
                            $(".div_queryAssetRestricted .res").JSONView(res);
                        })
                    },
                    c_priceChange:function(obj){
                        gel(".div_createAsset .price").innerText=(gel(".div_createAsset .quote").value/gel(".div_createAsset .base").value||1)
                        .toFixed(gel(".div_createAsset .precision").value||8)
                        +" COCOS / "+gel(".div_createAsset .symbol").value
                    },
                    u_priceChange:function(obj){
                        gel(".div_updateAsset .price").innerText=(gel(".div_updateAsset .quote").value/
                        (gel(".div_updateAsset .base").value||1)).toFixed(8)
                         +" COCOS/ "+gel(".div_updateAsset .symbol").value
                    },
                    getAccountBalances:function(){
                        bcx.queryAccountBalances({
                            assetId:gel(".div_queryAccountBalances .asset_id").value,
                            account:gel(".div_queryAccountBalances .account").value,
                            callback:function(res){
                                console.info('div_queryAccountBalances res',res);
                                $(".div_queryAccountBalances .res").JSONView(res);
                            }
                        });
                    },
                    queryAccountAllBalances:function(){
                        bcx.queryAccountAllBalances({
                            // assetId_or_symbol:gel(".div_getBalances .asset_id").value,
                            account:gel(".div_queryAccountAllBalances .account").value,
                            unit:gel(".div_queryAccountAllBalances .asset_id").value,
                            callback:function(res){
                                console.info('queryAccountAllBalances res',res);
                                $(".div_queryAccountAllBalances .res").JSONView(res);
                            }
                        });
                    },
                    assetUpdateRestricted:function(){
                        bcx.assetUpdateRestricted({
                            assetId:gel(".div_assetUpdateRestricted .asset_id").value,
                            isadd:gel(".div_assetUpdateRestricted .isadd").checked,
                            restrictedType:gel(".div_assetUpdateRestricted .restricted_type").value,
                            restrictedList:(gel(".div_assetUpdateRestricted .restricted_list").value).split(","),
                        }).then(res=>{
                            console.info('div_assetUpdateRestricted res',res);
                            $(".div_assetUpdateRestricted .res").JSONView(res);
                        })
                    },
                    assetClaimFees:function(){
                        bcx.assetClaimFees({
                            assetId:gel(".div_assetClaimFees .asset_id").value,
                            amount:Number(gel(".div_assetClaimFees .amount").value)
                        }).then(res=>{
                            console.info('div_assetClaimFees res',res);
                            $(".div_assetClaimFees .res").JSONView(res);
                        })
                    },

                    reserveAsset:function(){
                        bcx.reserveAsset({
                            assetId:gel(".div_reserveAsset .asset_id").value,
                            amount:Number(gel(".div_reserveAsset .amount").value)
                        }).then(res=>{
                            console.info('div_reserveAsset res',res);
                            $(".div_reserveAsset .res").JSONView(res);
                        })
                    },
                    issueAsset:function(){
                        bcx.issueAsset({
                            toAccount:gel(".div_issueAsset .to_account").value,
                            amount:Number(gel(".div_issueAsset .amount").value),
                            assetId:gel(".div_issueAsset .asset_id").value,
                            memo:gel(".div_issueAsset .memo").value,
                            isEncryption:gel(".div_issueAsset .isEncryption").checked
                        }).then(res=>{
                            console.info('issueAsset res',res);
                            $(".div_issueAsset .res").JSONView(res);
                        })
                    },
                    transferAsset:function(){
                        var amount=Number(gel(".div_transferAsset .transfer_amount").value);
                        let trxData={
                            fromAccount:gel(".div_transferAsset .from_account").value,
                            toAccount:gel(".div_transferAsset .to_account").value,
                            amount:amount,
                            assetId:gel(".div_transferAsset .asset_id").value,
                            memo:gel(".div_transferAsset .transfer_memo").value,
                            isPropose:gel(".div_transferAsset .isPropose").checked,
                            isEncryption:gel(".div_transferAsset .isEncryption").checked
                        };

                        bcx.transferAsset(trxData).then(res=>{
                            console.info('transferAsset res',res);
                            $(".div_transferAsset .res").JSONView(res);
                        })
                    },
                    queryAssets:function(symbol){
                        bcx.queryAssets({
                            symbol,
                            callback:function(res){
                                console.info("queryAssets res",res);
                                if(res.code!=1){
                                    return;
                                }
                                if(symbol){
                                    // var fields=document.querySelectorAll(".div_getAssets .list span");
                                    let {symbol,issuer_name,precision,dynamic,options}=res.data[0];
                                    gel(".div_getAssets .div_list").innerHTML=`<p>资产符号：<span class="symbol">${symbol}</span></p>
                                    <p>发行人：<span class="issuer_name">${issuer_name}</span></p>
                                    <p>小数位数：<span class="precision">${precision}</span></p>
                                    <p>当前供应量：<span class="current_supply">${dynamic.current_supply} ${symbol}</span></p>
                                    <p>最大供应量：<span class="max_supply">${options.max_supply} ${symbol}</span></p>
                                    <fieldset  class="fieldset_charge_market_fee">
                                        <legend>手续费 </legend>
                                        <p>手续费汇率：<span class="fee_pool">${options.core_exchange_rate?options.core_exchange_rate.text:'无'}</span></p>
                                        <p>市场手续费：<span class="market_fee_percent">${options.market_fee_percent} %</span></p>
                                        <p>市场手续费上限：<span class="max_market_fee">${options.max_market_fee} ${symbol}</span></p>
                                        <p>累积手续费池：<span >${dynamic.accumulated_fees} ${symbol}</span></p>
                                    </fieldset>
                                  `;
                                    return;
                                }

                               
                               

                                var assets_html=""
                                res.data.forEach(function(asset,index){
                                    assets_html+=`<tr>
                                                        <th scope="row">${(index+1)}</th>
                                                        <td ><a href="javascript:_assets.queryAssets('${asset.symbol}')">${asset.symbol}</a></td>
                                                        <td>${asset.issuer_name}</td>
                                                        <td>${asset.dynamic.current_supply.toFixed(asset.precision)}</td>
                                                  </tr>`
                                });
                                gel(".div_getAssets .table tbody").innerHTML=assets_html;

                               
                                // $(".div_getAssets .res").JSONView(res);
                            }
                        })
                    },
                    charge_market_fee_change:function(e){
                        gel(".div_createAsset .fieldset_charge_market_fee").style.display=e.target.checked?"block":"none";
                    },
                    updateAsset_charge_market_fee_change(e){
                        gel(".div_updateAsset .fieldset_charge_market_fee").style.display=e.target.checked?"block":"none";
                    },
                    isBitAssetChange:function(e){
                        gel(".div_createAsset .div_bitassetOpts").style.display=e.target.checked?"block":"none";
                    },
                    createAsset:function(){
                        bcx.createAsset({
                            assetId:gel(".div_createAsset .symbol").value,
                            maxSupply:gel(".div_createAsset .max_supply").value,
                            precision:gel(".div_createAsset .precision").value,
                            // chargeMarketFee:{//是否收取交易手续费,不传该参数说明不收取交易手续费
                            //     marketFeePercent:gel(".div_createAsset .market_fee_percent").value,
                            //     maxMarketFee:gel(".div_createAsset .max_market_fee").value
                            // },
                            description:gel(".div_createAsset .description").value,
                            isBitAsset:gel(".div_createAsset .isBitAsset").checked,
                            bitassetOpts:{
                                feedLifetimeSec:gel(".feedLifetimeSec").value,
                                minimumFeeds:gel(".minimumFeeds").value,
                                forceSettlementDelaySec:gel(".forceSettlementDelaySec").value,
                                forceSettlementOffsetPercent:gel(".forceSettlementOffsetPercent").value,
                                maximumForceSettlementVolume:gel(".maximumForceSettlementVolume").value,
                                // shortBackingAsset:gel(".shortBackingAsset").value,
                            }
                        }).then(res=>{
                            console.info("createAsset res",res);
                            $(".div_createAsset .res").JSONView(res);
                        })
                    },
                    updateAsset:function(){
                        let trxData={
                            assetId:gel(".div_updateAsset .symbol").value,
                            maxSupply:gel(".div_updateAsset .max_supply").value,
                            newIssuer:gel(".div_updateAsset .new_issuer").value,
                            coreExchangeRate:{
                                quoteAmount:gel(".div_updateAsset .quote").value,
                                baseAmount:gel(".div_updateAsset .base").value
                            },
                            whiteList:gel(".div_updateAsset .white_list").checked,
                            transferRestricted:gel(".div_updateAsset .transfer_restricted").checked,
                            description:gel(".div_updateAsset .description").value
                        }
                        if(gel(".div_updateAsset .is_charge_market_fee").checked){
                            trxData.chargeMarketFee={//是否收取交易手续费,不传该参数说明不收取交易手续费
                                marketFeePercent:gel(".div_updateAsset .market_fee_percent").value,
                                maxMarketFee:gel(".div_updateAsset .max_market_fee").value
                            }
                        }
                        if(gel(".div_updateAsset .isBitAsset").checked){
                            trxData.bitassetOpts={
                                feedLifetimeSec:gel(".div_updateAsset .feedLifetimeSec").value,
                                minimumFeeds:gel(".div_updateAsset .minimumFeeds").value,
                                forceSettlementDelaySec:gel(".div_updateAsset .forceSettlementDelaySec").value,
                                forceSettlementOffsetPercent:gel(".div_updateAsset .forceSettlementOffsetPercent").value,
                                maximumForceSettlementVolume:gel(".div_updateAsset .maximumForceSettlementVolume").value

                                // ,
                                // shortBackingAsset:gel(".shortBackingAsset").value
                            }
                        }
                        console.info("trxData",trxData);
                        bcx.updateAsset(trxData).then(res=>{
                            console.info("updateAsset res",res);
                            $(".div_updateAsset .res").JSONView(res);
                        })
                    }
                }

                var _wallet={
                    init:function(){
                        gel(".div_createAccountWithWallet .btn_signup").onclick=function(){
                            _wallet.createAccountWithWallet(false);
                        };

                        gel("#btn_backupDownload").onclick=_wallet.backupDownload;
                        gel(".div_restoreWalletFile .file").onchange=_wallet.loadWalletFile;
                        gel("#btn_restoreWallet").onclick=_wallet.restoreWallet;
                        gel("#btn_deleteWallet").onclick=_wallet.deleteWallet;
                        gel("#btn_importPrivateKey").onclick=_wallet.importPrivateKey;
                        gel("#btn_getAccounts").onclick=_wallet.getAccounts;

                        _wallet.getAccounts();
                    },
                    getAccounts:function(){
                        // var res=bcx.getAccounts();
                        bcx.getAccounts({
                            callback:res=>{
                                console.info("getAccounts res",res);
                                res=res.data;
                                $(".div_getAccounts .res").JSONView(res);

                                var accounts_html="";
                                res.accounts.forEach(function(account,index){
                                    var opt_htmls="";
                                    if(account!=res.current_account.account_name){
                                        opt_htmls=`<a href="javascript:_wallet.setCurrentAccount('${account}')">切换到当前账户</a>`;
                                    }
                                    accounts_html+=`<tr  >
                                        <th scope="row">${(index+1)}</th>
                                        <td>${account}</td>
                                        <td>${opt_htmls}</td>
                                    </tr>`
                                });
                                gel(".div_getAccounts table tbody").innerHTML=accounts_html;

                                gel(".current_account").innerText=res.current_account.account_name;
                            }
                        })
                       
                    },
                    setCurrentAccount:function(accountName){
                        bcx.setCurrentAccount({
                            account:accountName,
                            callback:function(res){
                                console.info("setCurrentAccount res",res);
                                _wallet.getAccounts();
                            }
                        });
                    },
                    restoreWallet:function(){
                        bcx.restoreWallet({
                            password:gel(".div_restoreWalletFile .password").value,
                            callback:function(res){
                                console.info("restoreWallet res",res);
                            }
                        })
                    },
                    createAccountWithWallet:function(){
                        bcx.createAccountWithWallet({
                            account:gel(".div_createAccountWithWallet .signup_username").value,
                            password:gel(".div_createAccountWithWallet .signup_pwd").value,
                            callback:function(res){
                                console.info("createAccountWithWallet res",res);
                                $(".div_createAccountWithWallet .res").JSONView(res);
                            }
                        })
                    },
                    backupDownload:function(){
                        bcx.backupDownload({
                            callback:function(res){
                                console.info("backupDownload res",res);
                            }
                        })
                    },
                    loadWalletFile:function(event){
                        bcx.loadWalletFile({
                            file:event.target.files[0],
                            callback:function(res){
                                console.info("loadWalletFile res",res);
                                gel(".div_restoreWalletFile .file").value="";
                                if(res.code==1){
                                    gel(".div_restoreWalletFile .sha1").innerText=res.data.sha1;
                                    gel(".div_restore").style.display="block";
                                }
                            }
                        })
                    },
                    deleteWallet:function(){
                        bcx.deleteWallet({
                            callback:function(res){
                                console.info("deleteWallet res",res);
                            }
                        })
                    },
                    importPrivateKey:function(){
                        bcx.importPrivateKey({
                            privateKey:gel(".div_importPrivateKey .privateKey").value,
                            password:gel(".div_importPrivateKey .pwd").value,
                            callback:function(res){
                                console.info("res",res);
                               _wallet.getAccounts();
                            }  
                        })
                    }
                }

                var _user={
                    init:function(){      
                        gel("#btn_signup").onclick=this.createAccountWithPassword;
                        gel("#btn_login").onclick=this.passwordLogin;
                        gel("#btn_keyLogin").onclick=this.keyLogin;

                        
                        gel("#btn_getUserInfo").onclick=this.getUserInfo;
                        gel("#btn_unlock").onclick=this.unlock;
                        gel("#btn_lock").onclick=this.lock;

                        gel("#btn_logout").onclick=this.logout;

                        gel("#btn_changePassword").onclick=this.changePassword;


                        gel("#btn_upgradeAccount").onclick=this.upgradeAccount;
                        gel("#btn_witnessCreate").onclick=this.witnessCreate;
                        gel("#btn_committeeMemberCreate").onclick=this.committeeMemberCreate;

                        gel("#btn_witnessUpdate").onclick=this.witnessUpdate;
                        gel("#btn_committeeMemberUpdate").onclick=this.committeeMemberUpdate;

                        
                        gel("#btn_queryUserInfo").onclick=this.queryUserInfo;
                        gel("#btn_getPrivateKey").onclick=this.getPrivateKey;
                        gel("#btn_getOperations").onclick=this.fetchAndSubscribe

                        gel(".div_createAccountWithPublicKey .btn_generateKey").onclick=this.generateKey;
                     
                        gel("#btn_createAccountWithPublicKey").onclick=this.createAccountWithPublicKey;             
                    },
                    createAccountWithPublicKey(){
                        bcx.createAccountWithPublicKey({
                            account:gel(".div_createAccountWithPublicKey .accountName").value,
                            ownerPubkey:gel(".div_createAccountWithPublicKey .owner_public_key").value,
                            activePubkey:gel(".div_createAccountWithPublicKey .active_public_key").value
                        }).then(res=>{
                            console.info("createAccountWithPublicKey res",res);
                            $(".div_createAccountWithPublicKey .res").JSONView(res);
                        })
                    },
                    generateKey(){
                        var random_key=bcx.generateKeys();
                        gel(".div_createAccountWithPublicKey .owner_public_key").value=random_key.public_key;
                        gel(".div_createAccountWithPublicKey .active_public_key").value=random_key.public_key;
                        $(".div_createAccountWithPublicKey .res_key").JSONView(random_key);
                    },
                    operations:[],
                    
                    fetchAndSubscribe:function(){
                        bcx.queryAccountOperations({
                            account: gel(".div_getOperations .account").value,
                            startId:"1.11.0",
                            endId:"1.11.0",
                            limit:gel(".div_getOperations .limit").value
                        }).then(res=>{
                            console.info("queryAccountOperations res",res);
                            if(res.code==1){
                                _user.operations=res.data;
                                renderOp(res.data,".div_getOperations tbody")
                            }
                        })
                        bcx.subscribeToAccountOperations({
                            account: gel(".div_getOperations .account").value,
                            callback:function(res){
                                // console.info("subscribeToUserOperations111111 res",res);
                                if(res.code==1){
                                    // _user.operations=res.data.operations;
                                    _user.operations.unshift(res.data.operation);
                                    if(_user.operations.length>100){
                                        _user.operations.length=100;
                                    }
                                    // console.info(" _user.operations", _user.operations);
                                    renderOp(_user.operations,".div_getOperations tbody")
                                }
                            }
                        })
                    },
                    getPrivateKey:function(){
                        bcx.getPrivateKey().then(res=>{
                            console.info(res);
                            $(".div_getPrivateKey .res").JSONView(res);
                        });
                    },
                    queryUserInfo:function(){
                        bcx.queryAccountInfo({
                            account:gel(".div_queryUserInfo .account").value,
                            callback:function(res){
                                console.info("queryUserInfo res", res);
                                $(".div_queryUserInfo .res").JSONView(res,{collapsed:true});
                            }
                        });
                    },
                    upgradeAccount:function(){
                        bcx.upgradeAccount().then(res=>{
                            console.info("upgradeAccount res",res);
                            $(".div_upgradeAccount .res").JSONView(res);
                        })
                    },
                    witnessCreate:function(){
                        bcx.witnessCreate({
                            url:gel(".div_witnessCreate .url").value,
                            blockSigningKey:gel(".div_witnessCreate .block_signing_key").value
                        }).then(res=>{
                            console.info("witnessCreate res",res);
                            $(".div_witnessCreate .res").JSONView(res);
                        })
                    },
                    committeeMemberCreate:function(){
                        bcx.committeeMemberCreate({
                            url:gel(".div_committeeMemberCreate .url").value,
                        }).then(res=>{
                            console.info("committeeMemberCreate res",res);
                            $(".div_committeeMemberCreate .res").JSONView(res);
                        })
                    },
                    
                    witnessUpdate:function(){
                        bcx.witnessUpdate({
                            newUrl:gel(".div_witnessUpdate .new_url").value,
                            newSigningKey:gel(".div_witnessUpdate .new_signing_key").value,
                            workStatus:gel(".div_witnessUpdate .work_status").checked
                        }).then(res=>{
                            console.info("witnessUpdate res",res);
                            $(".div_witnessUpdate .res").JSONView(res);
                        })
                    },
                    committeeMemberUpdate:function(){
                        bcx.committeeMemberUpdate({
                            newUrl:gel(".div_committeeMemberUpdate .new_url").value,
                            workStatus:gel(".div_committeeMemberUpdate .work_status").checked
                        }).then(res=>{
                            console.info("committeeMemberUpdate res",res);
                            $(".div_committeeMemberUpdate .res").JSONView(res);
                        })
                    },
                    getUserInfo:function(){                        
                        $(".div_getUserInfo .res").JSONView(bcx.getAccountInfo())
                    },
                   
                    createAccountWithPassword:function(){
                        bcx.createAccountWithPassword({
                            account:gel("#signup_username").value,
                            password:gel("#signup_pwd").value,
                            autoLogin:true,
                            callback:function(res){
                                console.info("signup res",res);
                            }
                        })
                    },
                    passwordLogin:function(){
                        bcx.passwordLogin({
                            account:gel("#login_username").value,
                            password:gel("#login_pwd").value,
                            callback:function(res){
                                console.info("passwordLogin res",res)
                                if(res.code==1){
                                    gel(".current_account").innerText=bcx.getAccountInfo().account_name;
                                }
                            }
                        })
                    },
                    importPrivateKey:function(){
                        bcx.importPrivateKey({
                            privateKey:gel(".div_importPrivateKey .privateKey").value,
                            password:gel(".div_importPrivateKey .pwd").value,
                            callback:function(res){
                                console.info("res",res);
                                if(res.code==1){
                                    // gel(".current_account").innerText=bcx.getUserInfo().name;
                                    // gel(".div_getOperations .account").value=bcx.getUserInfo().name;
                                }
                            }  
                        })
                    },
                    keyLogin:function(){
                        bcx.privateKeyLogin({
                            privateKey:gel(".div_keyLogin .privateKey").value,
                            password:gel(".div_keyLogin .pwd").value,
                            callback:function(res){
                                console.info("res",res);
                                if(res.code==1){
                                    gel(".current_account").innerText=bcx.getAccountInfo().account_name;
                                    gel(".div_getOperations .account").value=bcx.getAccountInfo().account_name;
                                }
                            }  
                        })
                    },
                    changePassword:function(){
                        bcx.changePassword({
                            oldPassword:gel(".div_changePassword .old_password").value,
                            newPassword:gel(".div_changePassword .new_password").value//,
                        }).then(res=>{
                            console.info("changePassword res",res);
                        })
                    },
                    logout:function(){
                        bcx.logout().then(res=>{
                            console.info("logout res",res);
                        })
                    },
                    unlock:function(){
                        bcx.unlockAccount({
                            password:gel(".div_unlock .pwd").value,
                            callback:res=>{
                                console.info("unlockAccount res",res);
                                gel(".h_msg").innerText=res.message;
                                if(res.code==1){
                                    gel(".current_account").innerText=bcx.getAccountInfo().account_name;
                                    gel(".div_getOperations .account").value=bcx.getAccountInfo().account_name;
                                    console.info("bcx.getUserInfo()",bcx.getAccountInfo());
                                    // fetchAndSubscribe();
                                }
                            }
                        })
                    },
                    lock:function(){
                        bcx.lockAccount({
                            callback:function(res){
                                console.info("lockAccount res",res);
                                gel(".h_msg").innerText=res.message;
                            }
                        });
                    }
                }

                var _nodes={
                    init:function(){
                        gel("#btn_getWSNodeList").onclick=_nodes.lookupWSNodeList;
                        gel("#btn_addAPINode").onclick=_nodes.addAPINode;
                        gel("#btn_disconnect").onclick=_nodes.disconnect;
                        gel("#btn_subscribeToRpcConnectionStatus").onclick=_nodes.subscribeToRpcConnectionStatus;
                    },
                    disconnect:function(){
                        bcx.disconnect({callback:function(res){
                            console.info("disconnect res",res);
                        }})
                    },
                    lookupWSNodeList:function(){
                        bcx.lookupWSNodeList({
                            refresh:true,
                            callback:res=>{
                                console.info("getWSNodeList res111",res);
                                if(res.code==1){
                                    gel(".div_getWSNodeList .selected_url").innerText=res.data.selectedNodeUrl
                                    var nodes_html="";
                                    res.data.nodes.forEach((node,index)=>{
                                        let {name,url,ping}=node;
                                        let connect=url!=res.data.selectedNodeUrl?
                                        `<a href="javascript:_nodes.switchAPINode('${url}')">连接</a>
                                        <a href="javascript:_nodes.deleteAPINode('${url}')">删除</a>`:"";
                                        nodes_html+=`<tr>
                                                <td>${index+1}</td>
                                                <td >${name}</td>
                                                <td>${url}</td>
                                                <td>${ping} ms</td>
                                                <td>${connect}</td>
                                            </tr>`
                                    });
                                    gel(".div_getWSNodeList tbody").innerHTML=nodes_html;
                                }
                            }
                        }); 
                    },
                    switchAPINode:function(url){
                        bcx.switchAPINode({
                            url,
                            callback:res=>{
                                console.info("switchAPINode res",res);
                                this.lookupWSNodeList();
                            }
                        })
                    },
                    addAPINode:function(){
                        bcx.addAPINode({
                            name:gel(".div_addAPINode .name").value,
                            url:gel(".div_addAPINode .address").value,
                            callback:res=>{
                                console.info("addAPINode res",res);
                                if(res.code==1){
                                   _nodes.lookupWSNodeList();
                                }
                            }
                        })
                    },
                    deleteAPINode:function(url){
                        bcx.deleteAPINode({
                            url,
                            callback:res=>{
                                console.info("deleteAPINode res",res);
                                this.lookupWSNodeList();
                            }
                        })
                    },
                    disconnect:function(){
                        bcx.disconnect(function(res){
                            console.info("disconnect res",res);
                        });
                    },
                    subscribeToRpcConnectionStatus:function(){
                        bcx.subscribeToRpcConnectionStatus({
                            callback:function(res){
                                console.info("subscribeToRpcConnectionStatus res",res);
                                $(".div_subscribeToRpcConnectionStatus .res").JSONView(res);
                            }
                        })
                    }
                }

    
                var _NHAssets={
                    create_nh_assets:[
                        {
                            assetId:"1.3.0",
                            worldView:"TEST",
                            baseDescribe:'{name:"预言家"}',
                            ownerAccount:"test2"
                        },
                        {
                            assetId:"1.3.0",
                            worldView:"TEST",
                            baseDescribe:'{name:"女巫"}',
                            ownerAccount:"test2"
                        },
                        {
                            assetId:"1.3.0",
                            worldView:"TEST",
                            baseDescribe:'{name:"猎人"}',
                            ownerAccount:"test2"
                        }
                    ],
                    init:function(){        

                        gel(".div_create_nh .items").value=JSON.stringify(_NHAssets.create_nh_assets);

                        gel("#btn_getAccountNHAssetForSell").onclick=this.getAccountNHAssetForSell
    
                        gel(".div_create_nh .base_describe").value=JSON.stringify({name:"预言家"});


                        gel("#btn_registerCreator").onclick=this.registerCreator;

                        gel("#btn_creatWorldView").onclick=this.creatWorldView;

                        gel("#btn_proposeRelateWorldView").onclick=this.proposeRelateWorldView

                        gel("#btn_create_nh").onclick=this.creatNHAsset;

                        gel("#btn_deleteNHAsset").onclick=this.deleteNHAsset;


                        gel("#btn_transferNHAsset").onclick=this.transferNHAsset;

                        gel("#btn_creatNHAssetOrder").onclick=this.creatNHAssetOrder

                        gel("#btn_queryNHAssetOrders").onclick=this.queryNHAssetOrders;

                        gel("#btn_queryAccountNHAssetOrders").onclick=this.queryAccountNHAssetOrders;

                        gel("#btn_queryAccountNHAssets").onclick=this.queryAccountNHAssets;

                        gel("#btn_lookupWorldViews").onclick=this.lookupWorldViews;

                        gel("#btn_queryNHCreator").onclick=this.queryNHCreator;

                        gel("#btn_queryNHAssetsByCreator").onclick=this.queryNHAssetsByCreator;       
                        
                        gel("#btn_queryNHAssets").onclick=this.queryNHAssets;       
                        
                        gel("#btn_loadAccountProposals").onclick=this.getAccountProposals;

                    },
                    approvalProposal:function(proposal_id){
                        bcx.approvalProposal({
                            proposalId:proposal_id,
                            callback:function(res){
                                console.info("approvalProposal res",res);
                                if(res.code==1){
                                    _NHAssets.getAccountProposals();
                                }
                            }
                        })
                    },
                    getAccountProposals:function(){
                        bcx.getAccountProposals({
                            account:gel(".div_loadAccountProposals .account").value
                        }).then(res=>{
                            console.info("res",res);
                            if(res.code==1){
                                var htmls="";
                                res.data.forEach(function(proposal,index){
                                    var status_htmls="";
                                    proposal.status.forEach(permission=>{
                                        status_htmls+=`<div class="rows" >
                                             <span>(${permission.weight_percentage})</span>  
                                             <span>${permission.account_name}</span>
                                             <input type="checkbox" class="isPropose" ${permission.isAgree?'checked':''} disabled  />
                                            </div>`
                                    })
                                    htmls+=`<tr>
                                        <td>${index+1}</td>
                                        <td>${proposal.id}</td>
                                        <td>${proposal.parse_operations_text}</td>
                                        <td>${proposal.expiration}</td>
                                        <td class="td-status" >${status_htmls}</td>
                                        <td><a  href="javascript:_NHAssets.approvalProposal('${proposal.id}')">批准</a></td>
                                    </tr>`
                                });
                                gel("#loadAccountProposals table tbody").innerHTML=htmls;
                            }
                        })
                    },
                    //核心NH资产相关函数
                    registerCreator:function(){
                        bcx.registerCreator().then(res=>{
                            console.info("registerCreator res",res);
                        })
                    },
                    creatWorldView:function(){
                        bcx.creatWorldView({
                            worldView:gel(".div_creatWorldView .world_view").value
                        }).then(res=>{
                            console.info('creatWorldView res',res);
                        })
                    },
                    proposeRelateWorldView:function(){
                        bcx.proposeRelateWorldView({
                            worldView:gel(".div_proposeRelateWorldView .world_view").value
                        }).then(res=>{
                            console.info('proposeRelateWorldView res',res); 
                        })     
                    },
                    creatNHAsset:function(){
                        bcx.creatNHAsset({
                            assetId:gel(".div_create_nh .asset_id").value,
                            worldView:gel(".div_create_nh .world_view").value,
                            baseDescribe:gel(".div_create_nh .base_describe").value,
                            ownerAccount:gel(".div_create_nh .owner_account").value,
                            NHAssetsCount:gel(".div_create_nh .nh_count").value,
                            type:gel(".div_create_nh .type").value,
                            NHAssets:_NHAssets.create_nh_assets,
                            callback:function(res){
                                console.info("creatNHAsset res",res);
                            }
                        });
                    },
                    deleteNHAsset:function(){
                        bcx.deleteNHAsset({
                            NHAssetIds:gel(".div_deleteNHAsset .NHAssetIds").value.split(","),
                            callback:function(res){
                                console.info('deleteNHAsset res',res);
                            }
                        })
                    },
                    transferNHAsset:function(){
                        bcx.transferNHAsset({
                            toAccount:gel(".div_transferNHAsset .to_account").value,
                            NHAssetIds:gel(".div_transferNHAsset .NHAssetIds").value.split(","),
                            callback:function(res){
                                console.info("transferNHAsset",res);
                            }
                        })
                    },
                    creatNHAssetOrder:function(){
                        var selData= gel("#div_sell .sel_goods");
                        bcx.creatNHAssetOrder(
                            {
                                otcAccount:gel(".div_creatNHAssetOrder .receiver").value,
                                orderFee:gel(".div_creatNHAssetOrder .token").value,
                                NHAssetId:selData.value,
                                price:gel(".div_creatNHAssetOrder .price").value,
                                priceAssetId:gel(".div_creatNHAssetOrder .priceAssetSymbol").value,
                                expiration:gel(".div_creatNHAssetOrder .expiration").value,
                                memo:gel(".div_creatNHAssetOrder .memo").value
                            }
                        ).then(res=>{
                            console.info('creatNHAssetOrder result',res);
                            $(".div_creatNHAssetOrder .res").JSONView(res);
                        })
                    },
                    cancelNHAssetOrder:function(nh_orders_index){
                        var NHAsset=this.account_sell_nh_orders[nh_orders_index];
                        console.info("NHAsset",NHAsset);
                        bcx.cancelNHAssetOrder({
                            orderId:NHAsset.id,
                            callback:function(res){
                                console.info("cancelNHAssetOrder res",res)
                                if(res.code==1)
                                _NHAssets.queryAccountNHAssetOrders();
                            }
                        })
                    },
                    fillNHAssetOrder:function(item_orders_index){
                        // let {id,seller_name,game_item_id,price_amount,price_asset_id,price_asset_symbol}=this.sell_nh_orders[item_orders_index];
                        bcx.fillNHAssetOrder({
                            orderId:this.sell_nh_orders[item_orders_index].id,
                            callback:function(res){
                                console.info("fillNHAssetOrder res",res)
                                _NHAssets.queryNHAssetOrders();
                            }
                        })
                    },
                    //查询函数
                    sell_nh_orders:[],
                    queryNHAssetOrders:function(){
                        var assetSymbolsOrIds=gel(".div_queryNHAssetOrders .assetSymbolsOrIds").value;
                        var world_views=gel(".div_queryNHAssetOrders .world_views").value;
 
                        bcx.queryNHAssetOrders({
                            assetIds:assetSymbolsOrIds,
                            worldViews:world_views,
                            baseDescribe:gel(".div_queryNHAssetOrders .baseDescribe").value,
                            pageSize:gel(".div_queryNHAssetOrders .pageSize").value,
                            page:gel(".div_queryNHAssetOrders .page").value,
                            callback:function(res){
                                console.info("queryNHAssetOrders res",res);
                                if(res.code==1){
                                    $(".div_queryNHAssetOrders tbody").html("");
                                     _NHAssets.sell_nh_orders=res.data;
                                     _NHAssets.sell_nh_orders.forEach(function(item,index){
                                        let className=item.seller_name+item.id.replace(/\./g,'');
                                        $(".div_queryNHAssetOrders tbody").append(`<tr class="${className}">
                                            <td>${index+1}</td>
                                            <td >${item.id}</td>
                                            <td >${item.nh_asset_id}</td>
                                            <td  >
                                                <div class="nh_base_describe"></div>
                                            </td>
                                            <td  >
                                                <div class="describe_with_contract"></div>
                                            </td>
                                            <td>${item.price_amount+" "+item.price_asset_symbol}</td>
                                            <td>${item.seller_name}</td>
                                            <td width="80" style="padding-right:6px;" >${item.expiration}</td>
                                            <td width="120" style="padding:0 5px;">${item.memo}</td>
                                            <td><a href="javascript:_NHAssets.fillNHAssetOrder(${index})">购买</a></td>
                                        </tr>`)
                                        $(".div_queryNHAssetOrders ."+className+" .nh_base_describe").JSONView(item.base_describe)
                                        if(item.describe_with_contract)
                                        $(".div_queryNHAssetOrders ."+className+" .describe_with_contract").JSONView(item.describe_with_contract)
                                    })
                                }
                            }
                        })
                    },
                    account_sell_nh_orders:[],
                    queryAccountNHAssetOrders:function(){
                        bcx.queryAccountNHAssetOrders({
                            account:gel(".div_queryAccountNHAssetOrders .account").value,
                            pageSize:gel(".div_queryAccountNHAssetOrders .pageSize").value,
                            page:gel(".div_queryAccountNHAssetOrders .page").value,
                            callback:function(res){
                                console.info('queryAccountNHAssetOrders res',res);
                                if(res.code==1){
                                     var table_htms="";
                                     $(".div_queryAccountNHAssetOrders tbody").html("");

                                    //<td width="80">${item.item_ID}</td>
                                     _NHAssets.account_sell_nh_orders=res.data;
                                     _NHAssets.account_sell_nh_orders.forEach(function(item,index){
                                        let className=item.seller_name+item.id.replace(/\./g,'');
                                        $(".div_queryAccountNHAssetOrders tbody").append(`<tr class="${className}">
                                            <td>${index+1}</td>
                                            <td >${item.id}</td>
                                            <td >${item.nh_asset_id}</td>
                                            <td  >
                                                <div class="game_item_base_describe"></div>
                                            </td>
                                            <td  >
                                                <div class="describe_with_contract"></div>
                                            </td>
                                            <td>${item.price_amount+" "+item.price_asset_symbol}</td>
                                            <td>${item.seller_name}</td>
                                            <td width="80" style="padding-right:6px;" >${item.expiration}</td>
                                            <td width="120" style="padding:0 5px;" >${item.memo}</td>
                                            <td><a href="javascript:_NHAssets.cancelNHAssetOrder(${index})">取消</a></td>
                                        </tr>`)

                                        $(".div_queryAccountNHAssetOrders ."+className+" .game_item_base_describe").JSONView(item.base_describe)
                                        $(".div_queryAccountNHAssetOrders ."+className+" .describe_with_contract").JSONView(item.describe_with_contract)
                                    })
                                }
                            }
                        })
                    },
                    queryAccountNHAssets:function(){
                        var worldViews=gel(".div_queryAccountNHAssets .worldViews").value;
                        if(worldViews){
                            worldViews=worldViews.split(",");
                        }else{
                            worldViews=[];
                        }
                        bcx.queryAccountNHAssets({
                            account:gel(".div_queryAccountNHAssets .account").value,
                            worldViews,
                            page:gel(".div_queryAccountNHAssets .page").value,
                            pageSize:gel(".div_queryAccountNHAssets .pageSize").value,
                            callback:function(res){
                                console.info('res',res);
                                $(".div_queryAccountNHAssets .res").JSONView(res);
                            }
                        })      
                    },
                    queryNHAssets:function(){
                        bcx.queryNHAssets({
                            NHAssetIds:gel(".div_queryNHAssets .NHAssetHashOrIds").value.split(","),
                            owner:true,
                            callback:function(res){
                                console.info("div_queryNHAssets res",res);
                                $(".div_queryNHAssets .res").JSONView(res);
                            }
                        })
                    },
                    lookupWorldViews:function(){
                        bcx.queryWorldViews({
                            worldViews:gel(".div_lookupWorldViews .worldViewNameOrIds").value.split(","),
                            callback:function(res){
                                console.info('lookupWorldViews res',res);
                                $(".div_lookupWorldViews .res").JSONView(res);
                            }
                        }); 
                    },
                    queryNHCreator:function(){
                        bcx.queryNHCreator({
                            account:gel(".div_queryNHCreator .account").value,
                            callback:function(res){
                                console.info('queryNHCreator res',res);
                                $(".div_queryNHCreator .res").JSONView(res)
                            }
                        }); 
                    },
                    queryNHAssetsByCreator:function(){
                        bcx.queryNHAssetsByCreator({
                            account:gel(".div_queryNHAssetsByCreator .account").value,
                            page:gel(".div_queryNHAssetsByCreator .page").value,
                            pageSize:gel(".div_queryNHAssetsByCreator .pageSize").value,
                            callback:function(res){
                                console.info('queryNHAssetsByCreator res',res);
                                $(".div_queryNHAssetsByCreator .res").JSONView(res);
                            }
                        }); 
                    },
                    //辅助demo的函数
                    getAccountNHAssetForSell:function(){
                        // if(bcx.getUserInfo()){
                        //     alert("请先登录或解锁账户")
                        // }
                        bcx.queryAccountNHAssets({
                            account:bcx.getAccountInfo().account_id,
                            worldViews:[],
                            callback:function(res){
                                console.info('queryAccountNHAssets res',res);
                                var sel_goods=gel(".div_creatNHAssetOrder .sel_goods");
                                var sel_goods_htmls='<option value="-1">请选择您要卖的NH资产</option>'
                                if(res.code==1){
                                    if(res.data.length){
                                        res.data.forEach(function(nh_asset){
                                            sel_goods_htmls+='<option value="'+nh_asset.id+'">'+nh_asset.id+" | "+nh_asset.base_describe+'</option>';
                                        });
                                    }
                                }
                                sel_goods.innerHTML=sel_goods_htmls;
                            }
                       })  
                    }
                }
                
             
                var _contracts={
                    init:function(){
                        gel(".div_call_contract_function .value_list").value=`4.2.0\n{"size":"large"}`;
                        gel("#btn_contract_create").onclick=this.createContract;

                        gel("#btn_update_contract").onclick=()=>{
                            this.updateContract();
                        }

                        gel("#btn_call_contract_function").onclick=this.callContractFunction;

                        gel("#btn_get_contract").onclick=this.queryContract;

                        gel("#btn_getAccountContractData").onclick=this.queryAccountContractData;

                        gel("#btn_generateKeys").onclick=this.generateKeys;
                        
                    },
                    updateContract(){
                        bcx.updateContract({
                            nameOrId:gel(".div_updateContract .name").value,
                            data:gel(".div_updateContract .data").value,
                        }).then(res=>{
                            console.info("div_updateContract res",res);
                            $(".div_updateContract .res").JSONView(res);
                        })
                    },
                    generateKeys(){
                        var random_key=bcx.generateKeys();
                        console.info("random_key",random_key);
                        gel(".div_generateKeys .privateKey").innerText=random_key.private_key;
                        gel(".div_generateKeys .publicKey").innerText=random_key.public_key;
                    },
                    queryAccountContractData:function(){
                        bcx.queryAccountContractData({
                            account:gel(".div_getAccountContractData .account_nameOrId").value,
                            contractNameOrId:gel(".div_getAccountContractData .contract_nameOrId").value,
                            callback:function(res){
                                console.info("queryAccountContractData res",res);
                                if(res.code==1){
                                    gel(".div_getAccountContractData .contract_name").innerText=res.data.contract_name;
                                    gel(".div_getAccountContractData .account_name").innerText=res.data.owner_account_name;
                                    $(".account_contract_data").JSONView(res.data.contract_data);
                                    $(".account_contract_data_type").JSONView(res.data.contract_data_type,{ collapsed: true })
                                }
                            }
                        })
                    },
                    queryContract:function(){
                        bcx.queryContract({
                            nameOrId:gel(".div_get_contract .contract_nameOrId").value,
                            callback:function(res){
                                console.info("queryContract res",res);
                                if(res.code==1){
                                    gel(".contract_name").innerText=res.data.contract_name;
                                    gel(".div_get_contract .account_name").innerText=res.data.owner_account_name;
                                    gel(".div_get_contract .create_date").innerText=res.data.create_date;
                                    var actions=[];
                                    res.data.abi_actions.forEach(action=>{
                                        actions.push(action.name);
                                    });
                                    gel(".actions").innerText=actions.join("，");
                                    $(".actions_describe").JSONView(res.data.abi_actions);
                                    $(".contract_data").JSONView(res.data.contract_data);
                                    $(".contract_data_type").JSONView(res.data.contract_data_type,{ collapsed: true });
                                    gel(".txt_source_code").value=res.data.lua_code;

                                }else{
                                    alert(res.message);
                                }
                            }
                        })
                    },
                    callContractFunction:function(){
                        let valueList=gel(".div_call_contract_function .value_list").value;
                        if(valueList){
                            valueList=valueList.split(/\n/);
                        }else{
                            valueList=[];
                        }
                        console.info("valueList",valueList);

                        //nameOrId=>合约名字或ID
                        bcx.callContractFunction({
                            nameOrId:gel(".div_call_contract_function .nameOrId").value,
                            functionName:gel(".div_call_contract_function .function_name").value,//["1",1000001,'COCOS']
                            valueList,//['4.2.0',{"type":"Employee","employeeId":"551"}],////[{"level":1,"color":"red","clothes":{"size":7}}],//
                            callback:function(res){
                                console.info("callContractFunction res",res);
                            }
                        })
                    },
                    createContract:function(){
                        bcx.createContract({
                            name:gel(".div_contract_create .name").value,
                            data:gel(".div_contract_create .data").value,
                            authority:gel(".div_contract_create .authority").value,
                            callback:function(res){
                                console.info("contract_create res",res);
                            }
                        })
                    }
                }
    

                function renderOp(operations,selector,isAllOP=false){
                    gel(selector).innerHTML="";
                    var operations_html=""
                    var memo="",more="";
                    var isLocked=bcx.getAccountInfo().locked;
                    operations.forEach(function(item,index){
                        more="";
                        memo=item.raw_data.memo||"";

                        if(memo){
                            if((item.type=="transfer"||item.type=="asset_issue")&&!isAllOP){
                               if(isLocked){
                                    memo=memo[0]==0?memo[1]:`<a href="javascript:decodeMemo(${index});">解锁</a>`;
                                }else{
                                    memo=memo[0]==0?memo[1]:bcx.decodeMemo(memo[1]);
                                    // console.info("memo",memo);
                                    if(memo.code==1)  memo=memo.data.text||"";
                                    if(memo)  memo="备注："+memo;
                                }
                            }else if(item.type=="creat_nh_asset_order"){
                                memo="备注："+memo;
                            }else{
                                memo="";
                            }
                        }

                        if(item.result.type=="error_result"||item.result.type=="contract_result"){
                            var results="";
                            if(item.result.type=="contract_result")
                                item.result.contract_affecteds.forEach(c_op=>{
                                     results+="<p>"+c_op.parse_operations_text+"</p>"
                                });

                            if(item.result.type=="error_result")  results= item.result.message; 
                            
                            more=`<a class="more" href="javascript:showOpMore(${index});" >查看结果</a>
                                  <div class="op_results">
                                    ${results}
                                  </div>`
                        }

                        var new_options_html="";
                        if(item.raw_data.new_options) new_options_html='<div class="new_options"><span class="green" >新的设定</span> <div></div></div>';

                        var tr = document.createElement('tr');
                        var op_class="op_"+item.id.replace(/\./g,"");
                        tr.className=op_class;
                        tr.innerHTML=`
                            <td scope="row" width="80">${item.block_num}</th>
                                <td width="140" >${item.type_name}</td>
                            <td style="max-width:500px; word-wrap: break-word; padding-right:10px;">
                                ${item.parse_operations_text} <span class="memo">${memo}</span>
                                ${more}
                                ${new_options_html}
                            </td>
                            <td>${item.parse_operations.fees}</td>
                            <td>${item.date}</td>`

                        gel(selector).appendChild(tr);
                        if(item.raw_data.new_options) $("."+op_class+" .new_options div").JSONView(item.raw_data,{ collapsed: true })
                    })
                    //gel(selector).innerHTML=operations_html;
                }

                function showOpMore(op_index,isAllOP){   
                    var _operations=isAllOP?_explorer.allOps:_user.operations;

                    var operation=_operations[op_index];
                    var op_el_id_selector=(isAllOP?".div_subscribeToChainTranscation":".div_getOperations")+" .op_"+operation.id.replace(/\./g,"");
                    operation.expand=!!operation.expand;
                    gel(op_el_id_selector+" .op_results").style.display=operation.expand?"none":"block";
                    gel(op_el_id_selector+" .more").innerText=operation.expand?"查看结果":"收起"; 
                    operation.expand=!operation.expand;                             
                }

                function decodeMemo(op_index){
                    var isLocked=bcx.getAccountInfo().locked;
                    if(isLocked){
                        gel(".h_msg").innerText="请先解锁账户";
                        alert("请先解锁账户");
                        return;
                    }
                    _user.fetchAndSubscribe();       
                }
                

                function gel(selector){
                    return document.querySelector(selector)
                }

                var _helper={
                    getTimeTo:function(time,isOnlyShowM=false){
                        var createDate = new Date(Date.parse(time.replace(/-/g, "/")));
                        var nowDate = new Date();
                        var m = parseInt(Math.abs((nowDate.getTime() - createDate.getTime()) /(1000*60)));
                        if (m < 60) {
                            if (m < 1) {
                                let s=parseInt(Math.abs(nowDate.getTime() - createDate.getTime())/1000);
                                if(s>0){
                                    return s+"秒前"
                                }
                                return "现在";
                            } else {
                                return m + "分钟前";
                            }
                        } else if(isOnlyShowM){
                            return time;
                        }else{
                            var createCurrentDayEndTime=new Date(createDate.format("yyyy/MM/dd")+" 23:59:59");
                            var createCurrentDayEndMin=parseInt((createCurrentDayEndTime.getTime()-createDate.getTime())/(1000*60));
                            if (m < createCurrentDayEndMin) {
                                return parseInt(m / 60) + "小时前";//return "今天 " + TimeToHourMin(time);
                            } else if (m > createCurrentDayEndMin && m < createCurrentDayEndMin + 24 * 60) {
                                return "昨天 " + this.TimeToHourMin(time)
                            } else if (createDate.getFullYear() == nowDate.getFullYear()) {
                                    return createDate.format("MM月dd日 HH:mm:ss");
                            } else {  return time; }
                        }
                    },
                    TimeToHourMin:function(dateTimeStr){
                        if (dateTimeStr.indexOf(" ") > -1) {
                            var arr = dateTimeStr.split(" ");
                            return arr[1].substring(0, arr[1].length - 3);
                        }
                        else { return dateTimeStr; }
                    }
                }
     
        </script>
    </body>
</html>